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

Daniel Barreto
PLUS
Daniel Barreto
Courses Plus Student 14,978 Points

Random white space to the right

Hey I'm quite frustrated with this maybe someone can help me out, I'm building a site and for some reason i have this unexplained white space all the way to the left. When i load the page, its not there; however, the horizontal scroll bar is appearing and when you scroll to the end there is this white space. This is also only affecting the body content. The header and footer extend the full way. I'm attaching a link to a screenshot. Hopefully someone has encountered this before.

https://www.dropbox.com/s/i8ymy5c8evl6t0q/download.png

11 Answers

Is there any chance you could provide me with your code with markdown? If you cannot post your code, then here are some possible reasons:

  1. The Background Image has a white space

  2. Your padding is incorrectly configured

  3. Your float is incorrectly configured

  4. Your sizes are incorrectly configured

As I have said, I cannot help any further without your source code.

Daniel Barreto
PLUS
Daniel Barreto
Courses Plus Student 14,978 Points

do you have an email i can send you a dropbox link? Not too comfortable having the code in public but dont mind you tinkering with it.

Yeah sure. alexcarr3000@gmail.com. Don't really care about that email going public.

Just wondering, what have you set the class name to for your background?

Daniel Barreto
PLUS
Daniel Barreto
Courses Plus Student 14,978 Points

so basically before the main body content, i have two empty divs. the first ones background img is attached to .blacklogo and the black page w/ white logo is #whitelogo

Thanks.

I think I'm nearly there. I found the source of it, but I'm still working on figuring out how you can disable it.

Okay, so basically, if you look at your Contact page, and scroll right the box is larger. The only possible explanation is that something from another page is being loaded after the black background, therefore becoming part of the foreground. For example

<p class="test1">This is a test</p>
<br>
<br>
<p class="big-white-box">Self explanatory</p>

The box (your problem) is being loaded after the test writing (background), therefore, not going behind it, but in front of it. There's not much more I can do, but I'll keep the files and keep looking through. Tell me if you figure it out, and I'll tell you if I figure it out.

No problem. As I say, I'll keep searching too.

Daniel Barreto
PLUS
Daniel Barreto
Courses Plus Student 14,978 Points

So, not the solution I was hoping for but it worked for me nonetheless,

I ended up doing this:

html,
body {
  overflow-x: hidden;
}

Yeah, that seems about right because it was basically a box overflowing.