网络学院 w3pop社区 网络资源 IT新闻

w3pop.com :: 网络学院 :: HTML :: HTML <h1> to <h6> 标签

会员登陆

帐号

密码

回答

记住密码

忘记密码? 注册

HTML <h1> to <h6> 标签


作者:w3pop.com 翻译/整理:w3pop.com 发布:2007-04-28 修改:2007-05-07 浏览:1861 :: ::

定义与用法

The <h1> to <h6> tags define headers. <h1> defines the largest header. <h6> defines the smallest header.
从<h1>到<h6>都是用来定义标题的。<h1>定义的为最大的标题.<h6>为最小的标题


它们在HTML和XHTML中的区别

The "align" attribute of the h1 to h6 element was deprecated in HTML 4.01.
在HTML4.01中不推荐使用h1到h6元素中的"align"属性

The "align" attribute of the h1 to h6 element is not supported in XHTML 1.0 Strict DTD.
XHML1。0严密型的DTD不再支持h1到h6元素的"align"属性


实例

代码 输出结果
<h1>This is header 1</h1>
<h2>This is header 2</h2>
<h3>This is header 3</h3>
<h4>This is header 4</h4>
<h5>This is header 5</h5>
<h6>This is header 6</h6>

This is header 1

This is header 2

This is header 3

This is header 4

This is header 5
This is header 6

 


可选属性

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
align left
center
right
justify
Specifies the alignment of the text in the header. Deprecated. Use styles instead
指定标题中的文字对齐。[不推荐]用样式来替代
TF

标准属性

id, class, title, style, dir, lang, xml:lang

For a full description, go to Standard Attributes.
查看完整的属性

事件属性

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

For a full description, go to Event Attributes.
查看完整的属性


尝试与演示

Headings
Demonstrates the different headings in an HTML document.
在HTML文档中不同的标题

Center aligned heading
Demonstrates a center-aligned heading.
居中的标题

评论 (0) All