Headings in HTML
?? Headings in HTML
Headings structure your content by dividing it into sections with different levels of importance.
Heading Tags
| Tag | Description | Example |
|---|---|---|
<h1> | Main heading (highest level) | <h1>Page Title</h1> |
<h2> | Subheading | <h2>Section Title</h2> |
<h3> | Sub-subheading | <h3>Subsection</h3> |
<h4> | Fourth level heading | <h4>Detail</h4> |
<h5> | Fifth level heading | <h5>Minor Section</h5> |
<h6> | Sixth level heading (lowest) | <h6>Smallest heading</h6> |
Usage Tips
Use headings in hierarchical order: start with
<h1>, then<h2>, etc.Only one
<h1>per page ideally (main topic)Headings improve SEO and accessibility (screen readers use them to navigate)
Example
<h1>My Blog</h1><h2>About HTML</h2><h3>Heading Tags</h3><h2>About CSS</h2>Need help with styling headings or using them for accessibility?