iPhone Full Screen Image

14,999

Solution 1

I'd say set the viewport meta tag in your blank page so Safari knows to render the page at the right size. For more information, see this link:

Apple iPhone Safari Documentation

Solution 2

Hopefully I'm not in breach of the NDA here, but here goes.

Mobile Safari, by default, renders a page as if that page had been viewed by a desktop browser, with a default width of 980 pixels.

To change this behavior you need to explicitly declare the viewport, which you do via meta tags. If you declare the width to the constant device-width, it'll default to 320 instead of 980, and everything looks great.

<head>
    <meta name="viewport" content="width=device-width,user-scalable=no" />
</head>
Share:
14,999
Smallinov
Author by

Smallinov

Independent IT Consultant in West Michigan

Updated on June 07, 2022

Comments

  • Smallinov
    Smallinov almost 2 years

    How do I go about making an image or section of the page full screen on the iPhone?

    I have an image that is 480 x 320 and I want to pull that up full screen on the iPhone but it has to be within a webpage so that I can make the image a link back to the previous page.

    Currently if I drop the image on a blank page and I open it up on the iPhone it just shows up in the top left corner.

  • Brad Parks
    Brad Parks about 10 years
    I'm not sure if it matters, but some examples I've seen also include the minimum-scale and maximum-scale as well. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">