当前位置: 首页 > 网络学院 > 网页制作基础教程 > HTML > HTML <meta>标签
The <meta> element provides meta-information about your page, such as descriptions and keywords for search engines and refresh rates.
<meta>标签可以给meta-infomation提供一些有关你页面的信息,比如针对搜索引擎的描述,关键字和刷新频率
In HTML the <meta> tag has no end tag.
在HTML中<meta>标签不需要关闭标签
In XHTML the <meta> tag must be properly closed.
在XHTML中<meta>标签必须合理关闭
Note: The <meta> tag always goes inside the head element.
注意:<meta>标签必须在head元素内使用
Note: Metadata is always passed as name/value pairs.
注意:meta所传送的数据总是以name/值这样的搭配形式。
Define keywords for search engines: 针对搜索引擎定义关键字: <meta name="keywords" content="HTML, DHTML, CSS, XML, XHTML, JavaScript, VBScript" /> |
Define a description of your web page: 定义页面内容的一些描述: <meta name="description" content="Free Web tutorials on HTML, CSS, XML, and XHTML" /> |
Define the last revision of your page: 定义页面最近一次修改: <meta name="revised" content="Hege Refsnes, 6/10/99" /> |
Refresh page every 5 seconds: 每5秒刷新一次页面 <meta http-equiv="refresh" content="5" /> |
DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
下表中的DTD列指明了被支持的DTD属性。S=Strict(精确的),T=Transitional(传统的),F=Frameset(框架)
属性 | 值 | 描述 | DTD |
---|---|---|---|
content | some_text | Defines meta information to be associated with http-equiv or name 定义与http-equiv 或name关联的meta信息 | STF |
属性 | 值 | 描述 | DTD |
---|---|---|---|
http-equiv | content-type expires refresh set-cookie | Connects the content attribute to an HTTP header 将content属性连接到HTTP header | STF |
name | author description keywords generator revised others | Connects the content attribute to a name 将content属性连接到name | STF |
scheme | some_text | Defines a format to be used to interpret the value of the content attribute 定义一种解释content属性值的格式。 | STF |
dir, lang, xml:lang |
For a full description, go to Standard Attributes.
查看完整的属性
Document description
Information inside a meta element describes the document.
如何用meta元素来描述文档
Document keywords
Information inside a meta element describes the document's keywords.
如何使用meta元素来定义文档的关键字
Redirect a user
This example demonstrates how to redirect a user if your site address has changed.
这这个实例中将演示如何将用户转移到另一个地址上