当前位置: 首页 > 网络学院 > 网页制作基础教程 > HTML > HTML <meta>标签

HTML
HTML 介绍
HTML 元素
HTML 基本标签
HTML 格式
HTML 实体字符
HTML 链接
HTML 框架
HTML 表格
HTML 列表
HTML 表单
HTML 图片
HTML 背景
HTML 颜色
HTML 颜色值
HTML 颜色名
HTML 便条
HTML 布局
HTML 字体
HTML 4.0
HTML 样式

HTML <meta>标签


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 444 ::
收藏到网摘: n/a

定义与用法

The <meta> element provides meta-information about your page, such as descriptions and keywords for search engines and refresh rates.
<meta>标签可以给meta-infomation提供一些有关你页面的信息,比如针对搜索引擎的描述,关键字和刷新频率


在HTML和XHTML中的区别

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.
这这个实例中将演示如何将用户转移到另一个地址上

评论 (0) All

登陆 | 还没注册?