Webpage starts zoomed in on mobile devices

荒凉一梦 提交于 2019-11-28 08:02:14

initial-scale=1.0 tells the browser to set the zoom level to normal (i.e. not zoomed in or out). You only need width=1000:

<meta name="viewport" content="width=1000">

Try this:

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

or

<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />

I also though that view port was the problem but after testing it I figured viewport was not the problem.

The problem in my case was the CSS: fixed width, or width: 100% instead of width: auto. So if you find that viewport is not the problem - CSS would likely be your next guess.

Hope that helps!

I tried playing with

<meta name="viewport" content="width=1000, initial-scale=1.0, maximum-scale=1.0">

and it seems my site is indeed rendered 1000px wide at scale 1. However, since my phone's screen has no space for the site, the site continues outside the viewport resulting in the feeling that the site is zoomed in.

Setting this value makes the site 1000px wide zoomed out:

 <meta name="viewport" content="width=1000">

Is this your issue?

On a side note, 1000px sounds a bit wide for a mobile website, but I assume this website is not originally made for mobile devices?

I've had a similar problem. Try this:

<meta name="viewport" content="width=1000; initial-scale=1, maximum-scale=1, minimum-scale=1"/>

I think it has to do with the minimum-scale, but I'm not very sure.

You can use this.

    <meta name="viewport" content="width=100%">

Try out this will help you...This worked for me

 <meta name="viewport" initial-scale=1.0 content="width=100%">

In My Case I could successfully stop zooming of the screen by just adding the following code with no extras.

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