iPhone Full Screen Image

南笙酒味 提交于 2019-12-14 03:42:27

问题


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.


回答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




回答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>



回答3:


nice links which may help you further:

How to optimize your website for mobile devices: http://solutions.treypiepmeier.com/2008/12/01/optimizing-a-website-for-iphone/



来源:https://stackoverflow.com/questions/121051/iphone-full-screen-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!