Website does not automatically fit to iphone scree

2019-08-30 05:58发布

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,..

2条回答
趁早两清
2楼-- · 2019-08-30 06:35
<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" />
查看更多
你好瞎i
3楼-- · 2019-08-30 06:41

use the following meta tag:

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

works for both tablet and mobile

查看更多
登录 后发表回答