How to restrict html body width when not displayed on iPhone?

Posted by Curyous on Stack Overflow See other posts from Stack Overflow or by Curyous
Published on 2010-04-10T23:53:20Z Indexed on 2010/04/11 0:03 UTC
Read the original article Hit count: 271

Filed under:
|
|

I have set up a web page to look good on the small screen of an iPhone, but when viewed on the desktop, and going right across the width of the browser, it looks terrible. Is there a way I can restrict the width to say, 480px when viewed on a big screen?

I tried

   body {     
          margin-left:auto;
          margin-right:auto;
          max-width:480px;
    }

but it seems to just set the width at 480px, even on an iPhone on portrait mode.

© Stack Overflow or respective owner

Related posts about html

Related posts about iphone