Reference: http://webdesign.tutsplus.com/tutorials/htmlcss-tutorials/quick-tip-dont-forget-the-viewport-meta-tag/
First, the homepage mobile phone wap2.0 page of the head to add the following meta tag, in the iphone browser page will be displayed in the original size, does not allow zooming.
Where: Width-viewport width height-viewport height initial-scale-Initial zoom ratio
Minimum-scale-Allows the user to zoom to the minimum scale Maximum-scale-allows the user to zoom to the maximum scale user-scalable-
Whether the user can manually scale C
Ii. for a detailed introduction to Meta, please refer to
Third, the following is a detailed introduction to the meta example of the original address
3. Meta element Visual area
By default, Safari on the iphone will display your page as if it were on a big screen desktop browser, with a width of 980 pixels, and then zoom out to fit the iphone's small screen, so users feel less and more blurry when they look at this page on their iphone. You have to zoom in to make it look real, it seems acceptable for a normal web page, but few people can tolerate a common application.
Fortunately, a special meta element can be used to correct the visual area:
<</span>meta
Name= "Viewport" content= "Width=device-width"/>
This element tells the browser to use the width of the device as the width of the viewable area, rather than the default of 980 pixels, we can look at two different examples.
Example 3 (link: http://www.sitepoint.com/examples/iphone-development-12tips/no-viewport.html) shows a simple paragraph element with no meta element visible area, The font is a little blurry. The actual operation in the iphone is as shown.
Figure 1 No visible area display effect
Example 4 (link: http://www.sitepoint.com/examples/iphone-development-12tips/viewport.html) includes a visual area element that now has a device width of only 320 pixels, The font is also clearer than the previous example. The actual operation in the iphone is as shown.
Figure 2 shows the visible area
In addition, you can manually set the value of the device-width, for example, if your blog page width is 750 pixels, then the best size of the desktop screen is 800x600 pixels, example 5 (Link: http://www.sitepoint.com/examples/ iphone-development-12tips/fixed750.html) shows a truncated version, if you browse it in the iphone, you'll see that the remaining space in 980 pixels is filled with white.
To eliminate extra space, you can use the Meta element visual area to set the width to 780 pixels:
<</span>meta
Name= "Viewport" content= "width=780"/>
Example 6 (link: http://www.sitepoint.com/examples/iphone-development-12tips/fixed750-viewport.html) shows the effect of the Meta element visual area layout being fixed.
The contents of the META element viewable area can include multiple comma-separated values, such as initial-scale–
The magnification level at which the user initially sees the page, and a common setting for the Web application is:
<</span>meta
Name= "Viewport" content= "Width=device-width,initial-scale=1,user-scalable=no"/>
This element sets the width to the maximum width of the device, preventing users from zooming in and out
Mobile page Size setting (i)