HTML Headings

HTML headings (<h1>, <h2>, <h3>, etc.) are used to create headings and subheadings on a web page. They are used to structure and organize the content of a web page and make it easier for users to understand the main points and navigate through the document.

‘h1’ is the largest heading tag and ‘h6’ is the smallest one. So h1 is used for most important heading and h6 is used for least important.

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

OUTPUT:

Headings are used to create a hierarchical structure for the content of a web page, with <h1> being the highest level heading and <h6> being the lowest. For example, <h1> can be used for the main heading of a web page, <h2> for the headings of the main sections of the page, and <h3> for subheadings within those sections.

Here is an example of how to use headings in an HTML document:

<h1>Welcome to fullstackadda.com</h1>
<p>This paragraph of text.</p>
<h2>About Me</h2>
<p>This is my second paragraph </p>
<h3>Tutorials</h3>
<ul>
  <li>HTML</li>
  <li>CSS</li>
  <li>JavaScript</li>
</ul>

In this example, the <h1> element is used for the main heading of the web page, <h2> for the heading of the “About Me” section, and <h3> for the heading of the “My Skills” section.

Using headings correctly is important for accessibility and search engine optimization (SEO) as it makes it easy for the users and search engines to understand the structure and hierarchy of the content on a web page. It is considered good practice to use headings in a logical order, starting with <h1> and then using the next heading level for subheadings.

html headings
  1. ‘h1’ is the largest heading tag and ‘h6’ is the smallest one.
  2. HTML headings (<h1>, <h2>, <h3>, etc.) are used to create headings and subheadings on a web page.