Great job! In this lesson, you learned about padding, margins, and the display properties of elements.
Let's review what you've learned so far:
- Padding is the spacing between a box's content and the borders of the box.
- Padding can be set equally on all sides of the content, or can be set specifically for certain sides of the content only.
- Margin is the spacing directly outside of a box's borders.
- Margins can be set equally on all sides of a box, or can be set specifically for certain sides of the box only.
display changes the default behavior of HTML elements.
visibility property hides an element, but does not remove the amount of space the element takes up on the page. If you want to hide that element and remove the empty space, use the
display property instead.
This lesson completes our overview of the standard box model. Understanding the box model is important if you want to understand web page layouts.
Unfortunately, the standard box model has a minor limitation: unreliable box dimensions. In the next lesson, you'll learn more about how to solve this problem using a quick, but important technique.