当前位置: 首页 > 网络学院 > 网页制作基础教程 > HTML > HTML <h1> to <h6> 标签
The <h1> to <h6> tags define headers. <h1> defines the largest header. <h6> defines the smallest header.
从<h1>到<h6>都是用来定义标题的。<h1>定义的为最大的标题.<h6>为最小的标题
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 1This is header 2This is header 3This is header 4This is header 5This 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.
居中的标题