Home  >  Article  >  Web Front-end  >  How to disable zooming in css

How to disable zooming in css

藏色散人
藏色散人Original
2021-04-09 14:26:007315browse

How to disable scaling in css: First open the corresponding front-end code file; then add the two attributes "maximum-scale=1.0, user-scalable=0" to the meta tag to disable page scaling.

How to disable zooming in css

The operating environment of this article: windows7 system, CSS3&&HTML5 version, Dell G3 computer.

How to set css to not allow page scaling?

How to set css to not allow page scaling? Disable page zoom?

Actually, just add the following two attributes to the meta tag:

maximum-scale=1.0, user-scalable=0

Among them, maximum-scale: the maximum zoom value allowed by the user; user-scalable: whether the user is allowed to zoom , the default attribute is yes or 1 to allow, and it needs to be set to no or 0 if it is not allowed;

Finally, the actual settings are as follows:

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

There are mainly these attributes in this:

width - the width of the viewport

height - the height of the viewport

initial-scale - the initial scaling ratio

minimum-scale - what the user is allowed to zoom to Minimum scale

maximum-scale - The maximum scale the user is allowed to zoom to

user-scalable - Whether the user can manually zoom

How to disable zooming in css

【 Recommended learning: css video tutorial

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

Statement:
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