HTML heading tags

Headings are the most important part of your content. It not only organizes your content but also helps search engines to understand your content is a systematic manner. There are six types of headings you can use in your content-

Importance of headings

  • h1 defines the most important heading and h6 defines the least important heading.
  • Search engines use the heading tags to understand the content of your web page and index it correctly.
  • h1 headings should be used for main headings, followed by h2 headings, then the less important h3, and so on.

HTML Headings Structure

  • Try not to use more than one h1 in your content. It should be the main title.
  • Try not to use bigger headings inside small headings.

If you will follow these two tips then your content structure might look like as shown.

Default CSS for headings

  • Browser have some default CSS styling for heading tags.
  • Browsers automatically add some space (called margin) before and after a heading.
  • h1 is rendered in biggest size and h6 in smallest.
  • You can always change the styles using custom CSS.

Styling HTML headings

You can use inline CSS to specify size and other styles to the heading.

Note: HTML inline styling is not recommended. Its always good to create a external CSS file and attach to the head section the html document. (Explained later)

Leave a comment

Your email address will not be published. Required fields are marked *