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

Julian McNeill
Julian McNeill
9,445 Points

HELP! white space on the right side of my mobile website

I go on my mobile website (http://julianmcneilldesigns.com) and there is white space on the right side of my site. After combing through my code a couple times I'm still confused as to why this is happening. if any one could help point me in the right direction that would be great

Not sure, but I like the website.

2 Answers

Matt Campbell
Matt Campbell
9,767 Points

You've either got something outside of the container the backgrounds are applied to, so it's making it's own space etc, or the CSS isn't quite right. When I resize my browser to mobile resolution, it's fine.

Doesn't do it in portrait either.

Check the meta for the differing viewports and the CSS.

Julian McNeill
Julian McNeill
9,445 Points

Thanks I'll look into that but I also just found a resolution by using overflow-x: hidden on the main wrapper div.

Matt Campbell
Matt Campbell
9,767 Points

It wierd. When you first load the page, it's fine and everything but content is off center and cut off. But, you can zoom out and then the white space appears.

This suggests to me that it is the content causing the issue. Try reducing the width of it to test for a solution.

Julian McNeill
Julian McNeill
9,445 Points

are you looking at the site on an iphone? thats weird because it wont zoom at all on my phone

Matt Campbell
Matt Campbell
9,767 Points

yeah I was. It's normal on first arrival but then you can zoom out and the white space is there. Only happens in portrait though, if I recall correctly.