h4 (HTML element)
Example
In this example, an
h4 element is used to define a section
heading:
<h4>Breaking regional news</h4>
- Type
- block-level element
- Contains
- inline elements
- Contained by
- other block-level elements (except other headings
h1-h6andp)
Description
The h4 is
used to indicate a heading whose level of importance is exceeded by
h1, h2, and h3. A
document may have several h4 elements, all of which
share the same level of importance. The default heading size is shown in
Figure 1.
In total, we have six heading levels to choose
from—h1 to h6—to add structure to
the web page. h1 is the highest heading level (and, by
default, the largest in terms of font size) and h6 the
lowest (and smallest).
A document’s first heading should be an
h1, followed by one or more h2
headings; each of these h2 headings can then have a
further series of h3 headings below them, and so on,
right on down to heading level 6. The HTML 4 spec states that heading
levels should not be skipped (that is, you shouldn’t have a series of
headings in the order h1, h2,
h2, h4, which skips the
h3 entirely), although it isn’t always possible to
guarantee such rigidity in the markup, particularly if your pages are
generated by a CMS. However, this goal is certainly one for which you
should aim.
Headings add semantic richness to a document, which can help with search engines’ understanding of the makeup of that document, and provide users of assistive devices (such as screen readers) with an additional—and quick—method by which to navigate through a document: they can skip from heading to heading.
Use This For …
This element may contain any text content, but it can’t include any block-level elements: only inline or phrase elements can be included.
Compatibility
| IE | 5.5 | Full |
|---|---|---|
| 6.0 | Full | |
| 7.0 | Full | |
| Firefox | 1.0 | Full |
| 1.5 | Full | |
| 2.0 | Full | |
| Safari | 1.3 | Full |
| 2.0 | Full | |
| 3.0 | Full | |
| Opera | 9.2 | Full |
| 9.5 | Full |
The
h4 element suffers no compatibility issues: all
browsers listed support it.
User-contributed notes
There are no comments yet.
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

