& Lt; meta name = & quot; viewport & quot; content = & quot; width = device-width, initial-scale = 1.0 & quot; & gt; understanding, metaviewportwidth

Source: Internet
Author: User

<Meta name = "viewport" content = "width = device-width, initial-scale = 1.0"> understanding: metaviewportwidth

The ViewPort <meta> flag is used to specify whether the user can scale the Web page. If yes, what is the maximum and minimum scaling ratio. Using the ViewPort <meta> flag also indicates that the document has been optimized for mobile devices. The content value marked by ViewPort <meta> is a comma-separated list composed of commands and their values.

Example:

<Meta name = "viewport" content = "width = 240, height = 320, user-scalable = yes, initial-scale = 2.5, maximum-scale = 5.0, minimun-scale = 1.0 ">


The width and height commands specify the logical width and height of the video area. Their values are either numbers in pixels or special markup symbols. The width command uses the device-width flag to indicate that the area width should be the screen width of the device. Similarly, the height command uses the device-height flag to indicate that the video height is the screen height of the device.

The user-scalable command specifies whether the user can scale the view area, that is, the view on the web page. If the value is yes, scaling is allowed. If the value is no, scaling is not allowed.

The initial-scale command is used to set the initial scale of a Web page. The default initial scaling ratio varies depending on the smartphone browser. Generally, the device displays the entire Web page in the browser. If it is set to 1.0, the unscaled Web document is displayed.

The maximum-scale and minimum-scale commands are used to set the user's limit on the scaling ratio of Web pages. The value range is 0.25 to 10.0. Same as initial-scale, the value of these commands is the scale ratio applied to the content of the view area.

All smart phone browsers support the width and user-scalabel commands marked by ViewPort <meta>. However, Opera Mobile does not use the user-scalable command, but advocates that users should always retain the ability to scale web pages in Mobile browsers.

 

From: http://www.cnblogs.com/ubunoon/archive/2012/07/27/2612243.html

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.