How to prevent a mobile device (mobile phone or pad) from enlarging a webpage by double-clicking a browser _ html5 tutorial-

Source: Internet
Author: User
This article mainly introduces how to prevent mobile devices (mobile phones and tablets) from double-clicking the browser to enlarge the webpage, if you need a browser, you can refer to the current mobile phone, tablet, and other mobile devices, which have double-click amplification settings by default. How can you avoid double-click amplification?

The meta viewport is provided on the Mobile Page and can be used to set scaling. However, before using viewport, you must change the document type of the page to Mobile type. Generally, the page DTD is An XHTML or simple HTML5 declaration. Mobile devices must use the following declaration.

The Code is as follows:


After the DTD is set, you can use viewport to disable page scaling. Generally, the user-scalable is set to 0 to disable the scaling of the page view.

The Code is as follows:


However, for better compatibility, we will use the complete viewport settings.


The Code is as follows:

For more details about viewport, see MDN.

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

It seems that the DTD can only be declared as HTML5, And the viewport label is added below.

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.