Home > Web Front-end > HTML Tutorial > How to automatically prevent mobile browsers from automatically resizing pages when designing responsively_html/css_WEB-ITnose

How to automatically prevent mobile browsers from automatically resizing pages when designing responsively_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:50:28
Original
1350 people have browsed it

As we all know, when designing responsive pages, we often encounter certain browsers that will reduce the size of the entire page to prevent the page from being intercepted.

We need to zoom in to See what's in it. This is the function of mobile browsers to automatically adjust the page.

This completely fails to meet the requirements of responsiveness.

Then the question is, how to prevent the browser from automatically adjusting the page size.

Sometimes when looking at responsive code written by others, you will often see the following code appearing in the head tag

<meta name="viewport" content="initial-scale=2.0,width=device-width"/>
Copy after login
The label, name="viewport" is self-evident, which refers to controlling the viewport. content="initial-scale=2.0" means enlarging the page twice (in the same way, 0.5 means reducing it by half, and 3.0 means enlarging it. 3 times),

At the same time, width=device-width tells the browser that the width of the page should be equal to the device width.

The tag can also control the zoomable range of the page. The following code allows the user to enlarge the page to a maximum of 3 times the device width and compress it to a minimum of half the device width.

<meta name="viewport" content="maximum-scale=3.0,minimum-scale="0.5",width=device-width"/>
Copy after login
Of course, zooming can also be disabled,

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




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