In HTML, headings are defined with the <h1>
to <h6>
tags, where <h1>
is the highest (or most important) level of heading, and <h6>
is the lowest. Here’s an example:
Example
<!DOCTYPE html>
<html>
<head>
<title>HTML Headings Example</title>
</head>
<body>
<h1>This is a heading 1</h1>
<h2>This is a heading 2</h2>
<h3>This is a heading 3</h3>
<h4>This is a heading 4</h4>
<h5>This is a heading 5</h5>
<h6>This is a heading 6</h6>
</body>
</html>
Description:
<h1>
is usually used for the main title of the page.- As you go down the levels (
<h2>
,<h3>
, etc.), the text size decreases, and it is generally used for subheadings and lesser important sections.