Summary and detailed explanation of meta tags in HTML

黄舟
Release: 2017-05-27 14:36:45
Original
2333 people have browsed it

meta tag function

META tag is a key tag in the HTML tagHEADarea, which provides the documentcharacter set, Using basic information such as language and author, as well as setting keywords and web page levels, the biggest role is to be able to dosearchengine optimization (SEO).

PS: It is convenient for search engine robots to search and classify. Internet applications should pay attention to it.

How to write large websites?

Before understanding this tag, I searched for their Meta settings on various mainstream websites, as follows:

Meta settings on JD.com’s homepage:

  
Copy after login
Copy after login

Meta setting of Taobao homepage:

     
Copy after login
Copy after login

Meta setting of youku homepage:

    
Copy after login
Copy after login

Douyu homepage Meta settings:

meta tag function

The META tag is a key tag in the HEAD area of HTML tags, providing basic information such as document character set, language, author, etc. Information, as well as the setting of keywords and web page levels, etc., are most useful for search engine optimization (SEO).

PS: It is convenient for search engine robots to search and classify, so Internet applications should pay attention to it.

How to write large websites?

Before understanding this tag, I searched for their Meta settings on various mainstream websites, as follows:

Meta settings on JD.com’s homepage:

  
Copy after login
Copy after login

Meta settings on Taobao homepage:

     
Copy after login
Copy after login

Meta settings on youku homepage:

    
Copy after login
Copy after login

meta detailed explanation

meta tag can be divided into two parts: http-equiv and name

variable

.

http-equiv

http-equiv is equivalent to the file header of http. It can return some useful information to the browser to help the browser correctly Display web page content.

Value content-type X -UA-Compatible IE browser DTD expires refresh ## set- cookie the local cookie.
Description Example
Set the character set used on the page


Copy after login


When GB2312, it represents the description The encoding used by the website is Simplified Chinese; when

ISO-8859-1, it means that the encoding used by the website is English; when

UTF-8, it means the universal language encoding;

PS: The

html5

page is to directly use

Special tag for IE8, used to specify the IE8 browser to simulate the rendering method of a specific version of, in order to solve some compatibility issues.
Copy after login
The above code tells the IE browser that regardless of whether the document standard is declared with
, IE8/9 will use the IE7 engine to render the page.
Copy after login
The above code tells the IE browser that IE8/9 will use the IE8 engine to render the page.
Copy after login
The above code tells the IE browser that IE8/9 and later versions will use the highest version of IE to render the page.
Copy after login


The above code IE=edge tells IE to use the latest engine to render web pages, and chrome=1 can activate Chrome Frame.

PS: Google adds a plug-in: Google Chrome Frame (Google Embedded Browser

Framework

GCF), this plug-in can keep the user's IE browser unchanged, but when the user browses the web, they actually use the Google Chrome browser core, and Supports multiple versions of IE browsers such as IE6, 7, and 8.

Set the expiration time of the web page.
Copy after login


PS: GMT time format must be used

automatic Refresh and point to the new page.
Copy after login


PS: 2 means that the page will stay for 2 seconds and then jump to the following URL

If the web page expires, then automaticallydelete
Copy after login

PS: GMT time format must be used.

windows-target 强制页面在当前窗口中以独立页面显示,可以防止自己的网页被别人当作一个frame页调用


Copy after login


cache-control 缓存机制
Copy after login


Public:指示响应可被任何缓存区缓存。

Private:指示对于单个用户的整个或部分响应消息,不能被共享缓存处理。这允许服务器仅仅描述当用户的部分响应消息,此响应消息对于其他用户的请求无效。

no-cache:指示请求或响应消息不能缓存。

no-store:用于防止重要的信息被无意的发布。在请求消息中发送将使得请求和响应消息都不使用缓存。

max-age:指示客户机可以接收生存期不大于指定时间(以秒为单位)的响应。

min-fresh:指示客户机可以接收响应时间小于当前时间加上指定时间的响应。

max-stale:指示客户机可以接收超出超时期间的响应消息。如果指定max-stale消息的值,那么客户机可以接收超出超时期指定值之内的响应消息。

name

name属性主要用于描述网页,与之对应的属性值为content,content中的内容主要是便于搜索引擎机器人查找信息和分类信息用的。

描述 例子
author 标注网页的作者


Copy after login
keywords 页面关键词,用于被搜索引擎收录


Copy after login
description 页面描述,用于搜索引擎收录


Copy after login
viewport 用于控制页面缩放
Copy after login
renderer 指定双核浏览器默认以何种方式渲染页面。
//默认webkit内核 //默认IE兼容模式 //默认IE标准模式
Copy after login

PS:360浏览器支持

generator 说明网站的采用的什么软件制作


Copy after login
revised 网页文档的修改时间


Copy after login
robots 用来告诉搜索机器人哪些页面需要索引,哪些页面不需要索引。


Copy after login

取值:all|none|index|noindex|follow|nofollow, 默认all

all:文件将被检索,且页面上的链接可以被查询

none:文件将不被检索,且页面上的链接不可以被查询;

index:文件将被检索;

follow:页面上的链接可以被查询;

noindex:文件将不被检索,但页面上的链接可以被查询;

nofollow:文件将不被检索,页面上的链接可以被查询。

copyright 网站版权信息


Copy after login

The above is the detailed content of Summary and detailed explanation of meta tags in HTML. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!