How Can I Make This Fit the iPhone Screen? (CSS Help)

Discussion in 'Mobile Web Development' started by ToasterEater, Jan 5, 2010.

  1. ToasterEater

    ToasterEater Member

    Joined:
    Jan 17, 2009
    Messages:
    537
    Likes Received:
    3
    Device:
    4G iPod touch
    Hi, I recently downloaded iWebKit, and i'm using the included style.CSS code to make a Web App, but when I view it in MobileSafari, it has the same proportions as if I was viewing it on a PC. How can I get this to look like a WebApp should? (Eg Cydia Pages)

    Can someone either edit the attached style.css (.txt because of attachment restrictions), or PM me one that you use? Or tell me how to fix it myself?

    Thanks!

    Attached Files:

  2. Shawa

    Shawa Super Moderator

    Joined:
    Jan 31, 2009
    Messages:
    3,188
    Likes Received:
    22
    Device:
    Nexus 4
    You need to set the viewport.
    Code:
            <meta name="viewport" content="width=device-width,user-scalable=no" />
    
    Add this to your header, and you're good to go!
  3. ToasterEater

    ToasterEater Member

    Joined:
    Jan 17, 2009
    Messages:
    537
    Likes Received:
    3
    Device:
    4G iPod touch
    Thanks a ton!

Share This Page