HTML Tutorial

HTML Tag: <h3>

Understanding <h3>

The <h3> tag is an HTML element used to represent a subheading or section title within a document or webpage. It is a type of heading element, classified under the heading elements (<h1>, <h2>, <h3>, <h4>, <h5>, and <h6>). The primary purpose of the <h3> tag is to organize and structure content, making it easier for users and search engines to navigate and understand the page.

Attributes of <h3>

The <h3> tag supports a limited number of attributes, including:

  • id: A unique identifier used to link to or style the heading.
  • class: A space-separated list of CSS class names used for styling purposes.
  • style: Inline CSS styling applied to the heading.
  • title: Additional information or a tooltip associated with the heading.

Usage of <h3>

The <h3> tag is typically used to create sub-sections or subheadings within a webpage. It is commonly placed after a <h2> tag and before a <h4> tag in the document hierarchy. The <h3> tag helps structure the content, making it easier for users to scan and find specific sections of interest.

Examples of <h3>

Here are some examples to illustrate the usage of the <h3> tag:

<body>
<h1>Main Heading</h1>
<h2>Section Title</h2>
<h3>Subsection Heading</h3>
<p>Content for the subsection...</p>
</body>

In this example, the <h3> tag is used to create a subsection heading within the section titled "Section Title."

<body>
<article>
<h2>Article Title</h2>
<section>
<h3>Paragraph Title</h3>
<p>Paragraph content...</p>
</section>
</article>
</body>

In this example, the <h3> tag is used to create a paragraph title within a section of an article.

Enhancing Accessibility with <h3>

The <h3> tag plays an important role in ensuring website accessibility. By using meaningful subheadings and organizing content logically, you make it easier for users with disabilities to navigate and access the information on the page. Additionally, the use of <h3> tags can improve the overall readability and comprehension of the content for all users.

Summary

The <h3> tag is a versatile heading element used to structure content and improve website accessibility. By understanding its functionality and attributes, you can effectively use it to create clear and organized web pages.