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

General Discussion

derekverrilli
derekverrilli
8,841 Points

How do I stop a site from getting pushed to the left when viewed on a phone?

I have noticed that even when using the meta viewport tag/attribute, on my phone the site is able to be pushed over to the left exposing whitespace from the right side. I thought I was doing something wrong but noticed it happens on the jQuery Mobile site (just to use as an example): http://jquerymobile.com/

In landscape mode it fills the viewport and doesn't move but in portrait I'm able to drag the whole page over to the left exposing whitespace.

Is there a way to stop that?

2 Answers

Julian Gutierrez
Julian Gutierrez
19,201 Points

Check for any elements breaking out of your containing div, or wrapper. On the jQuery Mobile site the "ThemeRoller" image and a tag are breaking out of its parent.

derekverrilli
derekverrilli
8,841 Points

Oh I see, perfect, thank you!

Konrad Pilch
Konrad Pilch
2,435 Points

Also check out the width of the element too. I see some sites that their ads are wide and it just pushes it everywhere. Bad sites : p