Page width problems on iPhone Safari – solved!

I was having a bear of a time trying to figure out why a web page was showing up too wide in Safari mobile today.  I thought everything was set up fine:  I had the meta tag to set the viewport to device-width, and the scale to 1.0, etc.  So I figured it was some element within the page that was somehow erupting from the bounds of the body element…but it was in fact the body element itself (and the html element) that needed some attention.  Make sure to set the body and html elements’ width and max-width CSS properties to 100%!  Problem solved.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: