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
erdragerdragsson
Courses Plus Student 5,887 PointsDiv problem!
if i add a new div with text on top of my content, but still in the container div,
it pushes my header down so its a gap on top of the page, heres a image on how it looks like http://imgur.com/N2f0x75 anyone know what the problem is? and how to fix it.
Kind regards.
// Erdrag
1 Answer
Stephen O'Connor
22,291 PointsCan you post your code? It looks like something has a top margin. Have you used a css reset?
erdragerdragsson
Courses Plus Student 5,887 Pointserdragerdragsson
Courses Plus Student 5,887 PointsStephen O'Connor
22,291 PointsStephen O'Connor
22,291 PointsAnd your HTML.
erdragerdragsson
Courses Plus Student 5,887 Pointserdragerdragsson
Courses Plus Student 5,887 PointsStephen O'Connor
22,291 PointsStephen O'Connor
22,291 PointsI can't see what might be causing it here ... can you upload your code to codepen or a test server and post the link? It might be a browser default styling for the image you are using in the header but without being able to inspect it live it is difficult to say.
Have you added a css reset to your stylesheet? Normalize for example?
erdragerdragsson
Courses Plus Student 5,887 Pointserdragerdragsson
Courses Plus Student 5,887 Pointsyeah i have added normalize,
and heres a codepen
http://codepen.io/anon/pen/emRgzP
erdragerdragsson
Courses Plus Student 5,887 Pointserdragerdragsson
Courses Plus Student 5,887 Pointsyou have any idea on how to fix it?
Stephen O'Connor
22,291 PointsStephen O'Connor
22,291 PointsYour codepen doesn't display the image and doesn't look like your posted image so it is very difficult to try and debug. Sorry. If you had it on a server, like a test server I could have a look, but for just now I can't help you I am afraid.
erdragerdragsson
Courses Plus Student 5,887 Pointserdragerdragsson
Courses Plus Student 5,887 Pointsi added some placehold.it pictures now
http://codepen.io/anon/pen/emRgzP