Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS Layout The CSS Box Model Padding

Gal Parselany
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Gal Parselany
Full Stack JavaScript Techdegree Graduate 26,281 Points

padding

i did those commands : Padding: 2em; padding-left: 35em; that commands centrelized my header, so i just want to understand if im doing that so the 'padding' will be only on padding-bottom, top and right and they will be all 2em, and the left will be 35? thanks

1 Answer

"When two values are specified, the first padding applies to the top and bottom, the second to the left and right. When three values are specified, the first padding applies to the top, the second to the right and left, the third to the bottom. When four values are specified, the paddings apply to the top, right, bottom, and left in that order (clockwise)."

What you are trying to do is not permitted by the standard

I recommend that you use four (4) values like this to ensure that only bottom, top and right are affected, that is, no padding on the left side.

.element {
padding: 2em 2em 2em 35em;
}