Be sure to also read this.
Common mistakes on Assignment 4:
- If you start Part 2 before Part 1 is perfect and finished, you are making extra work for yourself.
- You forgot to put
box-sizing: border-box;into a CSS rule that includes margin and/or padding.
- You used a width in pixels where a width in percentage would work better.
- You did not clear your floats correctly.
- You added too many declarations in a rule for one element. Less works better. Try to use the minimum possible to achieve what you want.
- If your background color inside an element has “collapsed,” read the “TIPS” note under Part 2 (3.b) in the assignment.
text-align: center;is ONLY for text. Never use it to center an image or any other element.
- You forgot that
h1are all very different things in HTML.
- We will never, ever use any color words in CSS. We use only hex codes for all colors.
- We will never put CSS into the HTML file. CSS stays in its own file with the .css extension.
Updates inspired during class:
- If you’re having trouble with the header color being too narrow (top to bottom), have you specified a background color for the header?
- Floating left and right: Again, this concerns the
nav). Even though you’re working on Part 1, read the “TIPS” note under Part 2 (3.b) in the assignment.
- Clearing floats: You do not need to add a class or an id to the HTML to clear floats. Just add the
clearproperty into the rule for the appropriate selector in your CSS.
- Trying to add some space below the white article box in Part 1? Using margin on the article element won’t work, because of margin collapse. Try adding
padding-bottomto a different element.