Tuesday, January 4, 2011

The h1, h2, h3, h4, h5 and h6 Elements

The h1, h2, h3, h4, h5 and h6 elements are used on headings. A heading is a short description of the document section it is in. Since a document can have many headings and sub-headings, HTML provides six elements from h1 to h6. h1 is at the top most of the hierarchy and h6 is at the lowest.

These are block elements that can only have inline elements as their child elements.

Since the various heading elements are used to indicate a hierarchy of headings and content, it doesn't make sense to skip levels. For example, after an h1 element, the next heading element should be h2 not any other heading element like h3.

An heading element can contain an image if the image's content describes the content of the document section.

Attributes
Core Attributes
The core attributes can be applied to this element.
align
This is a deprecated attribute. It can take as values either center, left, and right. The CSS property text-align should be used instead of this property.

No comments: