HTML 5

Chapter 6: Using

to

Tags in HTML

📝 Chapter 6: Using <h1> to <h6> Tags in HTML

HTML provides six levels of headings, from <h1> to <h6>. These heading tags help define the structure of your content, where <h1> is the most important and <h6> is the least.


✅ Example: Heading Tags in Action

<!DOCTYPE html>
<html>
<head>
<title>Welcome to My Website</title>
</head>
<body>

<h1>Welcome to My Website</h1>
<h2>Welcome to My Website</h2>
<h3>Welcome to My Website</h3>
<h4>Welcome to My Website</h4>
<h5>Welcome to My Website</h5>
<h6>Welcome to My Website</h6>

</body>
</html>


🔍 Explanation

Tag Meaning Font Size (Default)
<h1> Most important heading (biggest) 2em
<h2> Second level heading 1.5em
<h3> Third level heading 1.17em
<h4> Less important than <h3> 1.0em
<h5> Smaller heading 0.83em
<h6> Least important heading (smallest) 0.67em
📌 Note: These font sizes may slightly vary depending on the browser, but the hierarchy remains the same.

📚 Important Points

  • All six heading tags are predefined and supported by all major browsers.

  • These are block-level elements (each starts on a new line).

  • Heading tags also carry semantic meaning, so <h1> should be used for the main title of the page.

  • Never use headings just to make text bold or large. Use them to structure your content meaningfully.


🧠 SEO Tip

Search engines give more importance to text inside <h1> and <h2> tags. Use them wisely for better search engine optimization (SEO).

 

Leave a Reply

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