Home > Web Front-end > Front-end Q&A > How to disable page enlargement in html5

How to disable page enlargement in html5

青灯夜游
Release: 2023-01-11 09:19:52
Original
4050 people have browsed it

In html5, you can pass "<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">" Zooming in is prohibited.

How to disable page enlargement in html5

The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.

html5 prohibits mobile phone zooming (zooming in and out)

html5 page, and found that by default, users are allowed to zoom the page, or double-click on the screen to zoom in or out. That is equivalent to setting like this

<meta name="viewport" content="width=device-width, initial-scale=1.0 user-scalable=yes" />
Copy after login

If you want to disable zooming, just modify the corresponding parameters of the meta tag in the HTML:

<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
Copy after login

The function of this meta tag is to make the width of the current viewport equal to the width of the device , while not allowing users to manually zoom.

maximum-scale is the maximum zoom value allowed for the user, user-scalable is whether the user is allowed to zoom, yes (default) means allowed, no (0) means not allowed, the combination of the two can block the page Being amplified (after testing, none of the missing items can achieve the effect)

Recommended tutorial: "html video tutorial"

The above is the detailed content of How to disable page enlargement in html5. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template