In HTML, the
, ,... tags define headings of different levels, being the highest. Browsers typically apply preset top and bottom margins as well as different font sizes and weights to headings.
tags define headings of different levels, being the highest. Browsers typically apply preset top and bottom margins as well as different font sizes and weights to headings.
The headings elements from <h1>
to <h6>
represent six levels of element headings, where <h1>
is the highest s level and <h6>
is the lowest level.
Usage notes
- Heading information can be used by user agents to construct a table of contents for a document automatically.
- Avoid using heading elements to resize text. Instead, use the CSS font-size property.
- Avoid skipping heading levels: always start from
<h1>
, followed by<h2>
and so on.- Use only one
<h1>
per page or view. It should concisely describe the overall purpose of the content.- Using more than one
<h1>
will not result in an error, but is not considered a best practice. It is beneficial for screen reader users, and SEO.- While HTML5 allows a
<h1>
per sectioning element, it is not considered best practice, and may subvert the expectations of how screen reader users navigate.