Lesson 5 of 50
cssThe Box Model
10 mins
Course progress10%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 5 of 50
css10 mins
Keep these ideas in mind as you work through the lesson.
Every element is a rectangular box made of:
+---------------------------+
| margin (transparent) |
| +---------------------+ |
| | border | |
| | +---------------+ | |
| | | padding | | |
| | | +----------+ | | |
| | | | content | | | |
| | | +----------+ | | |
| | +---------------+ | |
| +---------------------+ |
+---------------------------+
.box {
width:200px; /* content width */
padding:20px; /* inner space */
border:5px solid #333; /* border */
margin:30px; /* outer space */
background:#f4f4f4;
}