The following introduces the commonly used head structure, as well as the meaning and usage scenarios of each tag and element (this article is based on the article of a master, and is an extended summary).
The header structure of padding.me
http://feeds.feedburner.com/paddingme" />
DOCTYPE
DOCTYPE (Document Type), this declaration is located at the front of the document, before the html tag. This tag tells the browser which HTML or XHTML specification the document uses.
DTD (Document Type Definition) declaration starts with , it is not case-sensitive, and there is no content in front. If there is other content (except spaces), the browser will turn on quirks mode in IE. Render the web page. Public DTD, the name format is "registration // organization // type tag // language", "registration" indicates whether the organization is registered by the International Organization for Standardization (ISO), means yes, - means no. "Organization" is the name of the organization, such as: W3C; "Type" is generally a DTD, and "Label" is a designated public text description, that is, a unique descriptive name for the referenced public text, which can be followed by a version number. The last "language" is the ISO 639 language identifier of the DTD language, such as: EN means English, ZH means Chinese. XHTML 1.0 can declare three DTD types. Represents strict version, transitional version, and frame-based HTML document respectively.
•
HTML 4.01 strict
http://www.w3.org/TR/html4 /strict.dtd">
•
HTML 4.01 Transitional
http://www.w3.org/TR/html4/loose.dtd">
•
HTML 4.01 Frameset
http://www.w3.org/TR/html4/frameset.dtd">
•
And the latest HTML5 introduces more concise writing, which is forward and backward compatible, and is recommended to be used.
The doctype in HTML has two main purposes.
•Verify the validity of documents.
It tells the user agent and validator what DTD this document is written according to. This action is passive. Every time the page is loaded, the browser will not download the DTD and check the validity. It is only enabled when the page is manually verified.
•Determine the browser's rendering mode
For actual operations, inform the browser which parsing algorithm to use when reading the document. If it is not written, the browser will parse the code according to its own rules, which may seriously affect the HTML layout. Browsers have three ways to parse HTML documents.
◦ Non-weird (standard) mode
◦ Weird mode
◦ Partially weird (almost standard) mode
About IE browser’s document mode, browser mode, strict mode, weird mode, DOCTYPE tag , detailed reading mode available? standard! , and the box model.
charset
Declare the character encoding used in the document,
Before html5, the web page would write like this:
These two are equivalent, you can read more specifically: http://stackoverflow.com/questions/4696499/meta-charset-utf-8-vs-meta-http-equiv-content- type, so it is recommended to use shorter ones that are easier to remember.
lang attribute
Simplified Chinese
Traditional Chinese
It is rarely necessary to add region codes, usually to emphasize the differences in Chinese usage in different regions, for example:
pineappleandPineapple is actually the same fruit. It's just that the names in mainland China and Taiwan are different, and the names in Singapore and Malaysia are also different. It's called Pine Pear.
For details, please go to http://zhi.hu/XyIa
Prioritize using the latest version of IE and Chrome
360 using Google Chrome Frame
360 Browser will immediately switch to the corresponding speed core after reading this tag.
Also join just to be on the safe side
The effect that can be achieved by writing this way is that if Google Chrome Frame is installed, GCF will be used to render the page. If GCF is not installed, the highest version of the IE kernel will be used for rendering.
Related links: Browser kernel control Meta tag documentation
Baidu prohibits transcoding
When you open a webpage through Baidu mobile phone, Baidu may transcode your webpage, take off your clothes, and put dog skin plaster ads on your body. To do this, you can add
Related links: SiteApp transcoding statement
SEO optimization part
•
Page title
Related links: WEB1038 - Tag contains invalid value
viewport
viewport can make the layout display better on mobile browsers.
Usually write
width=device-width will cause black borders to appear when the iPhone 5 is added to the home screen and opened in WebApp full-screen mode (http://bigc.at/ios-webapp-viewport-meta.orz )
content parameters:
•width viewport width (numeric value/device-width)
•height viewport height (numeric value/device-height)
•initial-scale initial scaling
•maximum- scale maximum scaling
•minimum-scale minimum scaling
•user-scalable whether to allow users to zoom (yes/no)
•
minimal-ui New attributes in iOS 7.1 beta 2, you can Minimize the upper and lower status bars when the page loads. This is a Boolean value and can be written directly like this:
And if your website is not responsive, please do not use initial-scale or disable scaling.
Related links: Viewport with non-responsive design
ios device
Title added to home screen (new in iOS 6)
Whether to enable WebApp full screen mode
Set the background color of the status bar
Only takes effect when "apple-mobile-web-app-capable" content="yes"
content parameters:
•default default value.
•black The background of the status bar is black.
•black-translucent The background of the status bar is black and translucent.
If set to default or black , the web page content starts from the bottom of the status bar.
If set to black-translucent, the web content will fill the entire screen and the top will be blocked by the status bar.
Disable digit recognition from being automatically recognized as a phone number
iOS icon
rel parameter:
apple-touch-icon pictures are automatically processed into rounded corners and highlights.
apple-touch-icon-precomposed prohibits the system from automatically adding effects and displays the original design directly.
iPhone and iTouch, default 57x57 pixels, must have
< ;!-- iPhone and iTouch, default 57x57 pixels, must have -->
iPad, 72x72 pixels, optional, but recommended
Retina iPhone and Retina iTouch, 114x114 pixels, optional, but recommended
Retina iPad, 144x144 pixels, optional but recommended
iOS splash screen
Official documentation: https://developer.apple.com/library/ios/qa/qa1686/_index.html
Reference article: http://wxd.ctrip. com/blog/2013/09/ios7-hig-24/
The iPad startup screen does not include the status bar area.
iPad portrait 768 x 1004 (standard resolution)
iPad portrait 1536x2008 (Retina)
iPad landscape 1024x748 (standard resolution)
iPad landscape 2048x1496 (Retina)
The startup screen of iPhone and iPod touch includes the status bar area.
iPhone/iPod Touch portrait screen 320x480 (standard resolution)
iPhone/iPod Touch portrait screen 640x960 (Retina)
iPhone 5/iPod Touch 5 vertical screen 640x1136 (Retina)
Add Smart App Banner (iOS 6 Safari)
Windows 8
Windows 8 tile colors
Windows 8 Tile Icon
RSS subscription
For a more detailed introduction to favicon, please refer to https://github.com/audreyr/favicon-cheat-sheet
Mobile meta
Sharing from toobug.
More meta tag references
•COMPLETE LIST OF HTML META TAGS
•18 Meta Tags Every Webpage Should Have in 2013
Reference article:
•https://github .com/yisibl/blog/issues/1
•https://gist.github.com/paddingme/6182708733917ae36331
•http://amazeui.org/css/
•http://www .douban.com/note/170560091/