Coding Geekette

Mobile Safari 4.0 + Horizontal Scrolling = SUX

Posted by: sarah on: December 1, 2009

Recently, I ran into an issue with how some of the sites I’m responsible for were displaying on Android 2.0 devices. Thanks to Google for providing a decent Android SDK - I was able to test my sites on Android 1.6 and Android 2.0. Android 1.6 displayed the sites fine, wrapping like it should. The exact sites in Android 2.0 had all this unnecessary whitespace on the right-hand side and allowed for a lot of unnecessary panning. At first it was reported as an Android 2.0 issue, but after seeing a friend’s iPhone that showed similar issues, I was able to narrow down the problem specifically to Mobile Safari 4.0.

Now maybe you guys like your whitespace. But I personally am not a fan of unnecessary scrolling on websites, and I don’t want my end users to have to deal with it either. After spending an afternoon with my favorite search engines, I finally found out how to get rid of the annoyance of horizontal scrolling.

The solution? All I needed to do was add the Apple-specific meta tag within my <head></head> tags:

<meta name = “viewport” content = “width = device-width”>

For this and more Apple-specific hacks, check out the Safari HTML Reference page on Meta Tags.

I spent way too much time trying to track this down, with so many people talking about their new Droid’s user agent string and only a couple references to the problem. So I hope this blog post hits the search engines and helps others out with Mobile Safari 4.0 and horizontal scrolling or panning.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Disclaimer

The thoughts here are those of Sarah Dutkiewicz personally and are not necessarily those of her clients or her publisher.

 

December 2009
S M T W T F S
« Nov   Jan »
 12345
6789101112
13141516171819
20212223242526
2728293031  

My Book

Automating Microsoft Windows Server 2008 R2 with Windows PowerShell 2.0

Buy it now!