Skip to content

Headings

Headings are used to define the structure of a document and to provide a visual hierarchy to the content. There are six levels of headings in HTML, ranging from <h1> to <h6>. The <h1> element is the highest level heading, and the <h6> element is the lowest level heading.

Syntax

A heading is defined using the following syntax:

html
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>

Default Styling

By default, headings are displayed in a larger and bolder font than the surrounding text. The size and weight of the font decrease as the level of the heading increases. For example, <h1> is the largest and boldest heading, while <h6> is the smallest and lightest heading.

To change the appearance of headings, you can use CSS to modify the font size, font weight, color, and other properties:

html
<h1 style="font-size: 36px; font-weight: bold; color: #333;">Custom Heading 1</h1>