HTML5 Mobile Page Scaling

Source: Internet
Author: User

HTML5 Mobile Page Scaling

When writing HTML5 mobile phone pages, we will find that the proportions of the elements displayed on the pages are incorrect. What we need to add at this time is:

<Meta name = "viewport" content = "width = device-width, initial-scale = 1">

Or

<Meta name = "viewport" content = "width = device-width, initial-scale = 1.0, minimum-scale = 0.5, maximum-scale = 2.0, user-scalable = yes "/>

Then we will explain this sentence as follows:

Viewport: indicates the display window;

Width = device-width, initial-scale = 1.0: indicates that the display window width is equal to the screen width of the device. initial-scale = 1.0, that is, the initial scaling ratio is 1.0;

Minimum-scale: minimum scale allowed

Maximum: indicates the maximum scale allowed.

User-scalable: Indicates whether to allow users to scale pages. The value can be yes or no.

 

Instance problems:

Symptom:

When you click the input box on the mobile phone page to edit the text, the page is automatically enlarged.

Solution:

Insert in the header

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

Or the user-scalable = no

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.