In #3 it asks for the .body
elements inside .content
to have no vertical margin and automatic horizontal margins so that it is centered. Is this a scenario where we have to use 3 instances of measurements such as * margin: 0px 0px auto * ? Is that valid? What should i put instead if this is wrong?
.content .body {
width: 90%;
margin: 0 0 auto
When you are setting top & bottom as the same value, and left & right as the same value, you use two instances of measurements:
.content .body {
width: 90%;
margin: 0 auto;
}
When do you declare three values?
Think of it this way, when you declare four measurements, they go in this order:
- Top
- Right
- Bottom
- Left
Two values:
- Top
- Right
Bottom matches Top, Left matches Right
And what if you declared only three?
- Top
- Right
- Bottom
Left will automatically match the Right value
So three values means: Top | Right & Left | Bottom
1 Like