How do I stop the mobile device (mobile, pad) browser from double-clicking the enlarged page?

Source: Internet
Author: User

Now on mobile devices such as mobile phones or tablets on the browser by default there is a double click to enlarge the settings, how to make a double click does not enlarge.

There is a meta viewport available on the mobile page that you can use to set the zoom. However, change the document type of the page to the mobile type before using viewport. The usual page DTD is either XHTML or a simple HTML5 declaration, and the mobile device uses the following statement.

<! DOCTYPE HTML PUBLIC "-//wapforum//dtd XHTML Mobile 1.0//en" "Http://www.wapforum.org/DTD/xhtml-mobile10.dtd" >

After you set up the DTD, you can use viewport to prevent the page from scaling. User-scalable is typically set to 0来 to turn off user scaling of page views.

<meta name= "viewport" content= "user-scalable=0"/>

But for better compatibility, we'll use the full viewport setting.

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

If you need more detailed information about viewport, you can refer to MDN

Https://developer.mozilla.org/en-US/docs/Mobile/Viewport_meta_tag

It seems that the DTD is only declared as HTML5, and the following plus the viewport tag

Reproduced from: http://www.9958.pw/post/html5_scalable

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.