CSS margin shorthand property
Margin shorthand property allows you to specify all necessary values at once separated by gaps. What happens if you don't define all 4 of them?
- When you set only one value, it applies to all four sides
- When you set two values, the first one defines the
top
andbottom
margin, while the second defines theleft
andright
margin - When you set 3 values, the first one defines the
top margin
, the second defines theleft
andright
, and the third defines thebottom