Meta tag implementation prevents mobile device (mobile phone, Pad) browser double click to enlarge Web page

Source: Internet
Author: User

I. BACKGROUND

In today's increasingly rapid development of mobile devices, and increasingly mature technology, mobile devices become an important area of enterprise expansion business, followed by the mobile phone to adapt to the endless, in the development process, we often encounter a very embarrassing problem: Mobile Web page when users double-click the screen will become larger , causing the layout of the entire page to be wrong and affecting the final effect, here's a way to prevent this from happening by using the META tag of HTML.

Ii. Solutions and principles

1. First set up the DOCTYPE of the webpage

1 <! DOCTYPE HTML > 2 < HTML > 3 .... 4 </ HTML >

2. Add the viewport meta tag to the head of the webpage as follows:

1 <  name= "Viewport"  content2                                      3                                       4                                      user-scalable=no ">

The Width property controls how wide the device is. Assuming your site will be browsed by a device with a different screen resolution, setting it to device-width will ensure that it renders correctly on different devices.

initial-scale=1.0 ensures that when the page loads, it is rendered at a scale of 1:1 without any scaling.

User-scalable=no can disable its zoom (zooming) feature on the mobile device browser.

Maximum-scale=1.0 is typically used with user-scalable=no. By disabling the zoom feature, users can only scroll the screen to make your site look more like the native app.

Iii. Summary

After this setting is complete, we have finished blocking the mobile device on the double-click causes the page to enlarge so that the page layout of the problem, there is wood is very happy?

Meta tag implementation prevents mobile device (mobile phone, Pad) browser double click to enlarge Web page

Related Article

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.