Explain HTML Headings
HTML headings are used to define the structure and hierarchy of content on a webpage. They range from <h1> to <h6>, with <h1> being the highest (or most important) level and <h6> the lowest.
Here’s a breakdown with examples:
1. <h1>: Main Heading
This is the most important heading and typically used for the main title of a page or section.
<h1>Welcome to My Website</h1>
2. <h2>: Subheading
Used for subsections under the main heading.
<h2>About Us</h2>
3. <h3>: Sub-subheading
For further subdivision under <h2> headings.
<h3>Our Mission</h3>
4. <h4>: Sub-sub-subheading
Used for even more detailed sections under <h3> headings.
<h4>Core Values</h4>
5. <h5>: Lesser Heading
Used for additional levels of detail under <h4> headings.
<h5>Commitment to Quality</h5>
6. <h6>: Smallest Heading
The least important heading, used for very specific or minor sections.
<h6>Quality Assurance Process</h6>
Example of Usage
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>Main Heading: Our Company</h1>
<h2>Our Services</h2>
<h3>Consulting</h3>
<h4>Strategy Consulting</h4>
<h5>Market Analysis</h5>
<h6>Competitive Analysis</h6>
<h3>Technology Solutions</h3>
<h4>Software Development</h4>
</body>
</html>
In this example:
<h1> is used for the main title of the page.
<h2> introduces a new section under the main title.
<h3>, <h4>, <h5>, and <h6> provide further breakdowns within each section.
The use of these headings helps with SEO (Search Engine Optimization) and accessibility by providing a clear structure to the content.