HTML/Elements/h1, h2, h3, h4, h5, and h6

From W3C Wiki
< HTML‎ | Elements
Revision as of 14:50, 22 July 2011 by Plehegar (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

<h1>, <h2>, <h3>, <h4>, <h5>, and <h6>

These elements represent headings for their sections.

Point

  • These elements have a rank given by the number in their name. The h1 element is said to have the highest rank, the h6 element has the lowest rank, and two elements with the same name have equal rank. [Example A]


HTML Attributes

See global attributes.


Examples

Example A

[try it]

<body>
  <h1>Let's call it a draw(ing surface)</h1>
  <h2>Diving in</h2>
  <h2>Simple shapes</h2>
  <h2>Canvas coordinates</h2>
  <h3>Canvas coordinates diagram</h3>
  <h2>Paths</h2>
</body>

Hn01.png

Here is that same means [try it]:

<body>
 <h1>Let's call it a draw(ing surface)</h1>
 <section>
  <h1>Diving in</h1>
 </section>
 <section>
  <h1>Simple shapes</h1>
 </section>
 <section>
  <h1>Canvas coordinates</h1>
  <section>
   <h1>Canvas coordinates diagram</h1>
  </section>
 </section>
 <section>
  <h1>Paths</h1>
 </section>
</body>

Hn02.png

HTML Reference

The HTML5 specification defines the <h1>, <h2>,<h3>,<h4>,<h5>,<h6> elements in 4.4.6 The h1, h2, h3, h4, h5, and h6 elements.