Website does not automatically fit to iphone screen

点点圈 提交于 2019-12-24 19:10:19

问题


The following code does not fit onto the iphone screen; how do I have to define the viewport?

<html>
<body>
<center>
<div id="karteu" style="background: url('../customer/Karten/karte1.jpg') no-repeat left center;width:714px;height:540px;" >
</div>
</body>
</html>

Normally the site should be zoomed, so i first should see the website in small, and then be able to zoom that i see it in the original size, but in my case it does not, when i call the site, the zoom is, that the image has this original size already, and that i have to scroll, but i dont want to scroll,...i want to use the normal safari mobile zoom and then scroll

The solution at the bottom does not zoom anything. I want to see the overview of the image at the beginning. Then i want to be able to zoom with the normal safari zoom functions,..


回答1:


<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=0;" />
<meta name="apple-mobile-web-app-capable" content="yes" />



回答2:


use the following meta tag:

<meta name="viewport" content="width=*your site width*, initial-scale=0.30">

works for both tablet and mobile



来源:https://stackoverflow.com/questions/2673294/website-does-not-automatically-fit-to-iphone-screen

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