Meta tag of WebApp

Source: Internet
Author: User

I. META tags
<meta name= "Apple-touch-fullscreen" content= "yes" > "Add to Home Screen", full screen <meta name= " Apple-mobile-web-app-capable "content=" yes "/>
The META function is to delete the default Apple toolbar and menu bar. The content has two values "yes" and "no", and when we need to display the toolbar and menu bar, the row meta is not added, the default is display.

<meta name= "Apple-mobile-web-app-status-bar-style" Content=black "/>
Defaults are default (white), which can be set to Black (dark) and black-translucent (gray translucent).
Note: If the value "Black-translucent" will occupy the page px position, floating above the page (will cover the page 20px height –iphone4 and itouch4 Retina screen is 40px).

There are two meta values in iOS, apple-mobile-web-app-capable and Apple-mobile-web-app-status-bar-style, both of which make the Web content appear in the app style and make the status bar transparent.
<meta name= "apple-mobile-web-app-capable" content= "yes" >
<meta name= "Apple-mobile-web-app-status-bar-style" content= "black-translucent" >


<link rel= "apple-touch-icon-precomposed" href= "Http://spion.blog.163.com/blog/iphone_milanoo.png"/>
Note: This link is to set the Web App placement on the Home screen icon file path.
Image size can be set to 57*57 (px) or retina can be set to 114*114 (px), ipad size is 72*72 (px)

<meta content= "Telephone=no" name= "format-detection"/>
<meta content= "Email=no" name= "format-detection"/>The mailbox will not be recognized
Tell the device to ignore numbers in the page as phone numbers

iOS with rel= "Apple-touch-icon", Android with Rel= "apple-touch-icon-precomposed". This allows you to create an app-style icon in your phone's home screen when the user saves the page as a bookmark.
<link rel= "Apple-touch-icon" href= "/static/images/identity/html5_badge_64.png"/>
<link rel= "apple-touch-icon-precomposed" href= "/static/images/identity/html5_badge_64.png"/>

<meta name= "viewport" content= "width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0" >

Reference:http://www.w3school.com.cn/html5/html5_meta.asp

Two. 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:

<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, There is no meta element visible area and the font is a bit 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, Now the device is only 320 pixels wide, and the font is 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:

<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 the magnification level that initial-scale– users initially see when the page is viewed, and a common setting for Web applications is:

<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

Meta tag of WebApp

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.