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

Problem with landing page. (html + css)

I am trying to create a landing page for a website but am having a very hard time because there is white space at the top of the page, before the image, and causes a scroll bar to appear in order to see the rest of the image. Here is a screenshot: http://imgur.com/a/tDJ26. And here is my code:

SASS: html height: 100%

body height: 100%

header background-image: url(/img/filler-img.jpg) height: 100% background-size: cover margin: 0% 0% 0% 0% auto padding: 0%

2 Answers

Abraham Juliot
Abraham Juliot
47,353 Points

Hi Andrew,

Do you have a live version of the code? You can share your code through a git hub repo or a live editor like codepen.io, c9.io, repl.it, or jsfiddle.net. The best way to fix this is to use Chrome dev tools, select the element (or any element), and tinker with the styles till you find the property causing the white space.

Resources:

Mackenzie Bowes
Mackenzie Bowes
2,237 Points
body {
  margin: 0 auto;
  padding: 0;
}