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
jayp22
5,448 PointsWhite margin space still existing..
Hi everyone! Just a small question. So I'm building a landing page for the last 30 mins, but I seem to have a problem with the margin space between the body and the header. I thought that by setting the body margin to 0, one would remove all additional margin. I've been trying to set the h1 margin to 0, and this works, but then I'm kind of stuck having it at the top..
body {
margin: 0;
}
header {
background-color:orange;
}
h1 {
color: white;
font-size: 90px;
}
1 Answer
ivannnnn
58 PointsHi. The margin is caused by the h1 's margin. Set it to 0 and the space between your header and body should disappear. For the h1 you can use padding instead of margin. Ivan