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

The box model

Add a padding of 20px to the top and bottom of the div with the class box. Then, add 40 pixels of padding to the left and right sides.

1 Answer

Adam Duffield
Adam Duffield
30,494 Points

I'm unsure exactly what your after from this but that would be written as...

padding: 20px 40px;

the 1st 20px counts for both top and bottom and the 2nd counts for the left and right, this could otherwise be written like this in the order: Top, Right, Bottom, Left.

padding:20px 40px 20px 40px;

Hope this helps..