How to automatically prevent mobile browsers from automatically adjusting the page size during responsive design

Source: Internet
Author: User

How to automatically prevent mobile browsers from automatically adjusting the page size during responsive design

As we all know, when designing a responsive page, we often encounter some browsers that will narrow down the entire page to prevent page interceptions,

We need to zoom in to see the content. This is the function for mobile browsers to automatically adjust pages.

This completely fails to meet the responsive requirements.

So the question is, how can we prevent the browser from automatically adjusting the page size.

Sometimes, when looking at the response code written by others, the following code is often displayed in the head label.

<Meta name = "viewport" content = "initial-scale = 2.0, width = device-width"/>
<Meta> tag, name = "viewport" is self-evident, it refers to the control of the access. content = "initial-scale = 2.0" means to enlarge the page twice (likewise, 0.5 indicates that the image size is reduced by half, and 3.0 indicates that the image size is increased by three times ),

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

<Meta> the tag can also control the page's scalable range. The following code allows the user to zoom in to a maximum of three times the width of the device, and compress the page to a minimum of half.

<Meta name = "viewport" content = "maximum-scale = 3.0, minimum-scale =" 0.5 ", width = device-width"/>
Of course, scaling can also be disabled,

<Meta name = "viewport" content = "initial-scale = 1.0, user-scalable = no"/>




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.