Common HTML META tag attributes (site compatibility and optimization required), META tags

Source: Internet
Author: User


Common HTML META tag attributes (site compatibility and optimization required), META tags




Heat1 reviews 143


Www.BkJia.Com Netizens share: 2014-12-29 01:12:00 views 11,936 times


Common HTML META tag attributes (site compatibility and optimization required), META tags




The tag provides metadata about the HTML document. The metadata is not displayed on the page, but is readable for the machine. It can be used in browsers (how to display content or reload pages), search engines (keywords), or other Web services


Original address: http://segmentfault.com/blog/ciaocc/1190000002407912
Ciaocc
Copyright CIAOCC All, reproduced please specify the copyright.

Profile

The tag provides metadata about the HTML document. The metadata is not displayed on the page, but is readable for the machine. It can be used in browsers (how to display content or reload pages), search engines (keywords), or other Web services. --w3school

Required Attributes


Properties value Description
Content Some text Define meta information related to the HTTP-EQUIV or Name property


Optional properties


Properties value Description
Http-equiv Content-type/expire/refresh/set-cookie Associate the Content property to the HTTP header.
Name Author/description/keywords/generator/revised/others Associate the Content property to a name.
Content Some text Defines the format used to translate content property values.



SEO optimization

Reference documents

page Keywords , each page should have a unique set of keywords that describe the content of the page.
Use descriptive and Representative keywords and phrases that people may search for and accurately describe the information provided on the page. Tag content is too short, the search engine may not think of the content as relevant. Additional tokens should not exceed 874 characters.


The code is as follows: <meta name= "keywords" content= "your tags"/>




page Description , each page should have a no more than 150 characters and can accurately reflect the content of the page description tag.


The code is as follows: <meta name= "description" content= "Words"/>


Search engine indexing method, Robotterms is a set of values separated by commas (,), usually have the following values: None,noindex,nofollow,all,index and follow. Make sure that the nofollow and Noindex property values are used correctly.





The code is as follows:
<meta name= "Robots" content= "Index,follow"/>
<!--
All: The file will be retrieved and the link on the page can be queried;
None: The file will not be retrieved, and the link on the page cannot be queried;
Index: The document will be retrieved;
Follow: Links on the page can be queried;
NOINDEX: The document will not be retrieved;
Nofollow: Links on the page cannot be queried.
-


page redirection and refresh : The number within the content represents the time (in seconds) that is refreshed after a few minutes. If the URL is added, it is redirected to the specified Web page (search engines can be automatically detected and easily punished by the engine as misleading).





The code is as follows:
<meta http-equiv= "Refresh" content= "0;url="/>


Other





The code is as follows:
<meta name= "Author" content= "author name"/> <!--define page author--
<meta name= "google" content= "Index,follow"/>
<meta name= "Googlebot" content= "Index,follow"/>
<meta name= "Verify" content= "Index,follow"/>




Mobile devices

Viewport: Can optimize the display of mobile browser. If it is not a responsive web site, do not use Initial-scale or disable scaling.
Most of the 4.7-5-inch devices have a viewport width of 360px;5.5 inch set to 400px;iphone6 set to 375px;ipone6 plus set to 414px.


The code is as follows:
<meta name= "viewport" content= "Width=device-width, initial-scale=1.0,maximum-scale=1.0, User-scalable=no"/>
<!--' Width=device-width ' will cause IPhone 5 to appear black when the page is opened in WEBAPP full screen mode after adding to the main screen


1.width: Width (value/device-width) (range from 200 to 10,000, default to 980 pixels)
2.height: Height (value/device-height) (range from 223 to 10,000)
3.initial-scale: Initial zoom ratio (range from >0 to 10)
4.minimum-scale: The minimum scale to allow the user to zoom
5.maximum-scale: Allows the user to zoom to the maximum scale
6.user-scalable: Whether the user can manually indent (no,yes)
7.minimal-ui: You can minimize the upper and lower status bar when the page loads. (deprecated)
Note that many people use initial-scale=1 to non-responsive websites, which makes the site render at 100% width, and the user needs to manually move the page or zoom. If you use User-scalable=no or maximum-scale=1 with initial-scale=1 at the same time, users will not be able to zoom in/out of the page to see all the content.



WebApp Full screen mode: Fake app, offline app.





The code is as follows:
<meta name= "apple-mobile-web-app-capable" content= "yes"/> <!--enable WEBAPP full Screen mode--


Hide status bar/Set status bar color: Only takes effect when webapp full screen mode is turned on. The content value is default | Black | Black-translucent.





The code is as follows:
<meta name= "Apple-mobile-web-app-status-bar-style" content= "Black-translucent"/>


Title after adding to the main screen





The code is as follows: <meta name= "Apple-mobile-web-app-title" content= "title" >


Ignore numbers automatically recognized as phone numbers


The code is as follows: <meta content= "Telephone=no" name= "Format-detection"/>


Ignore recognition mailboxes





The code is as follows: <meta content= "Email=no" name= "Format-detection"/>


Add Smart App Banner Smart app Banner: Tell the browser the app that corresponds to this website and display the download Banner (for example) on the page. Reference documents





The code is as follows: <meta name= "Apple-itunes-app" content= "App-id=myappstoreid, Affiliate-data=myaffiliatedata, app-argument= Myurl ">


Other reference documents


xml/html Code copy content to clipboard
  1. <!--optimized for handheld devices, mainly for older browsers that do not recognize viewport, such as BlackBerry--and
  2. <Meta name="handheldfriendly" content="true">
  3. <!--Microsoft's Vintage browser--
  4. <Meta name= "mobileoptimized" content= "+" >
  5. <!--UC Force vertical screen--
  6. <Meta name= "screen-orientation" content="Portrait">
  7. <!--QQ Forced vertical screen--
  8. <Meta name= "x5-orientation" content="Portrait">
  9. <!--UC Mandatory fullscreen--
  10. <Meta name="Full-screen" content="yes">
  11. <!--QQ Mandatory fullscreen--
  12. <Meta name="X5-fullscreen" content="true">
  13. <!--UC Application Mode--
  14. <Meta name= "browsermode" content="Application">
  15. <!--QQ Application Mode--
  16. <Meta name="X5-page-mode" content="apps">
  17. <!--windows Phone Click No Highlight--
  18. <Meta name= "msapplication-tap-highlight" content="No">


Web related



Declaration Code





The code is as follows: <meta charset= ' Utf-8 '/>


Use the latest version of IE and Chrome first





The code is as follows:
<meta http-equiv= "x-ua-compatible" content= "ie=edge,chrome=1"/>
<!--about X-ua-compatible--
<meta http-equiv= "x-ua-compatible" content= "ie=6" ><!--use IE6-
<meta http-equiv= "x-ua-compatible" content= "ie=7" ><!--use IE7-
<meta http-equiv= "x-ua-compatible" content= "ie=8" ><!--use IE8-


Browser Kernel control : Many domestic browsers are dual-core (WebKit and Trident), WebKit kernel high-speed browsing, IE core-compatible Web pages and the old version of the site. Web sites that add Meta tags can control what kernel rendering the browser chooses. Reference documents





The code is as follows: <meta name= "renderer" content= "Webkit|ie-comp|ie-stand" >




The default kernel mode for dual-core browsers is as follows:



1. Sogou high-speed browser, QQ browser: IE core (compatibility mode)



Prevents browsers from accessing page content from the local computer's cache: This setting allows visitors to browse offline.





The code is as follows: <meta http-equiv= "Pragma" content= "No-cache" >


Windows 8





The code is as follows:
<meta name= "Msapplication-tilecolor" content= "#000"/> <!--Windows 8 tile Color--
<meta name= "Msapplication-tileimage" content= "Icon.png"/> <!--Windows 8 tile icon--


Site adaptation: Mainly used for pc-mobile phone page of the corresponding relationship.





The code is as follows:
<meta name= "mobile-agent" content= "FORMAT=[WML|XHTML|HTML5"; Url=url ">
<!--
[WML|XHTML|HTML5] According to the protocol language of the mobile page, select one of them;
The url= "url", which represents the URL of the mobile page for the current PC page, must be a one by one correspondence.
-


Transcoding declaration: Using Baidu to open the Web page may be transcoded (such as stickers), to avoid transcoding can add the following meta





The code is as follows: <meta http-equiv= "Cache-control" content= "No-siteapp"/>


Common HTML META tag attributes (site compatibility and optimization required), META tags


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.