Padding and Margin Properties
Get introduced to the padding and margin properties of inline and block layouts.
We'll cover the following
In the Zombie Width and Height lesson, we learned the size property of inline and block layouts. In this lesson, let’s have a look at padding and margin properties.
Padding direction agnostic zombies
-
padding-inline-start
: The size of the padding at the start of the inline direction(This is the writing-direction-agnostic version of padding-left.)
-
padding-inline-end
: The size of the padding at the end of the inline direction(This is the writing-direction-agnostic version of padding-right.)
-
padding-block-start
: The size of the padding at the start of the block direction(This is the writing-direction-agnostic version of padding-top.)
-
padding-block-end
: The size of the padding at the end of the block direction(This is the writing-direction-agnostic version of padding-bottom.)
.padding-direction-agnostic-zombies {
padding-inline-start: 1em;
padding-inline-end: 1em;
padding-block-start: 0.5em;
padding-block-end: 0.5em;
}
Experiments to try:
- What happens if you remove the
box-sizing
property?
Create a free account to view this lesson.
By signing up, you agree to Educative's Terms of Service and Privacy Policy