Search code examples
iphonehtmlmobile-safari

Making my site (which is 480px wide) scale perfectly on mobile safari


The main body of my site is 480px wide - see example here: http://5things.me/

It should fit perfectly on the iphone, but somehow the default view seems to be using a far wider grid.

I am showing 2 images below - the first one is what it currently appears as, the second one is what is should appear as.

I should not need to do too much mobile customization, since the whole site is only 480px wide =)

current

desired


Solution

  • Add this to your page

    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
    

    Look here for more iPhone-related tags: http://www.omiod.com/iphone/dev-notes.php