Locked lesson.
About this lesson
Understanding the CSS Box Model for your design and layout.
Exercise files
Download this lesson’s related exercise files.
Box Model.docx58.6 KB Box Model - Solution.docx
58.8 KB
Quick reference
Box Model
Use the box modely to determine the exact size of your element.
When to use
Any time you're using height and width as well as padding, margin, and/or borders.
Instructions
The box model, from the inside to the outside is:
Content (height and width)
Padding
Border
Margin
Content is on the very inside, Margin is on the very outside.
Hints & tips
- Use the box model to determine total size of an element
- Content height and width is the innermost property
- Margin is the outermost property
- The progression from inside to out is: Conent, Padding, Border, Margin
Lesson notes are only available for subscribers.