HTML <h1> to <h6> tags


Six different HTML headings:

<h1>这是标题 1</h1>
<h2>这是标题 2</h2>
<h3>这是标题 3</h3>
<h4>这是标题 4</h4>
<h5>这是标题 5</h5>
<h6>这是标题 6</h6>

Try it yourself

Browser Support

IE Firefox Chrome Safari Opera

All browsers support <h1> - <h6> tags.

Definition and Usage

<H1> - <h6> tags to define the title. <H1> defines the maximum title. <H6> defines the minimum title.

Since the h element has the exact semantics, so please carefully select the appropriate tab to build a hierarchical structure of the document. Therefore, do not use the title tag to change the font size in the same row. Instead, we should use Cascading Style Sheets is defined to achieve a beautiful display.

If you want to know more information about the selection and use of HTML tags, read " the Web quality ."

Differences between HTML and XHTML

In HTML 4.01, h1 - "align" attribute h6 element is not recommended.

In XHTML 1.0 Strict DTD in, h1 - "align" attribute h6 element is not supported.

Optional attributes

Attributes value description
  • left
  • center
  • right
  • justify

Not recommended. Use styles instead.

The provisions of this title Chinese arrangement.

Standard property

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

For a full description, go to Standard property .

Event Properties

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

For a full description, go to Event Attributes .

Examples TIY

This example demonstrates that displays the title tag in the HTML document.
Centered Titles
This example demonstrates a title centered arrangement.