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
Dan Neumann
Courses Plus Student 10,318 PointsCSS 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.
4 Answers
Matthew Krueger
18,416 PointsThey may be looking looking for :
padding: 5px;
}```
to give 5px of padding on all sides, including top and bottom
Ary de Oliveira
Courses Plus Student 28,304 PointsSince 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; } */
Dan Neumann
Courses Plus Student 10,318 PointsThat's it. Thanks
Maxwell Messina
9,939 PointsI ran into this also. "...padding on each side." is a bit misleading.
Jesus Mendoza
23,289 PointsJesus Mendoza
23,289 PointsTry with padding: 5px; that will add padding in all 4 sides