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 Adding Padding

I think this is answered correctly but I get an error.

The question is:

Since there is no border, padding, or content to separate the top margin of our logo with the top margin of the body, we're seeing a margin collapsing issue in the header. Let's fix this by giving .main-header 5px of padding on each side.

My answer is:

.main-header { padding-left: 5px; padding-right: 5px; }

The error I get is:

Bummer! Make sure you're giving .main-header 5px of padding on each side.

I don't see what I'm doing wrong.

Try with padding: 5px; that will add padding in all 4 sides

4 Answers

They may be looking looking for :

     padding: 5px;
}```
 to give 5px of padding on all sides, including top and bottom

Since there is no border, padding, or content to separate the top margin of our logo with the top margin of the body, we're seeing a margin collapsing issue in the header. Let's fix this by giving .main-header 5px of padding on each side. here this ok work...

/* .main-header { padding: 5px; } */

That's it. Thanks

I ran into this also. "...padding on each side." is a bit misleading.