Services Work Learn About Contact
0/8
Lesson 4 of 8

The Box Model

Every HTML element is a box. The CSS box model consists of: content, padding, border, and margin.

Content is the actual text/image. Padding is space inside the border. Border wraps padding. Margin is space outside the border.

CSS
.box {
  width: 200px;
  padding: 20px;
  border: 2px solid #333;
  margin: 10px;
}
🧠

Quick Quiz

Answer correctly to unlock the next lesson.

Support the mission

This learning platform is 100% free: no ads, no tracking, no paywalls. If it helped you learn something useful, you can support future lessons or donate to Doctors Without Borders, which provides emergency medical care in crisis zones worldwide.

🎉

You completed CSS!

You finished all 8 lessons and quizzes. You now know the basics of CSS.