The <h5> Element in HTML

The <h5> element is used to create a smaller sub-heading beneath an <h4>. It helps to break down information into more detailed sections, especially when content is very structured.

While <h4> introduces a deeper topic inside a section, <h5> can be used to give extra detail or highlight a specific point under that topic. Think of <h5> as a fine-detail heading — useful when explaining steps, features, or lists within a subsection. You can use multiple <h5> headings on a page when breaking content into smaller, clearer parts.

h5 element - Educodes

Understaning the layout of the <h5> Element

Start tagElement contentEnd tag
<h5>Famous Landmarks</h5>

📘 Example Code

Below is an HTML example showing headings from <h1> down to <h5>:

💡 This is what the code looks like inside an editor

<!DOCTYPE html> <html> <head> <title>Detailed Topic Example</title> </head> <body> <h1>My Travel Blog</h1> <h2>Popular Destinations</h2> <h3>Top Countries to Visit</h3> <h4>Best Cities in Europe</h4> <h5>Famous Landmarks</h5> <p>These cities are known for iconic sites that attract millions of visitors.</p> </body> </html>

🖥️ What This Will Look Like in a Browser

✅ Example output you would see on a webpage:

My Travel Blog
Popular Destinations
Top Countries to Visit
Best Cities in Europe
Famous Landmarks
These cities are known for iconic sites that attract millions of visitors.

🧪 Time to Practise!

Now it’s your turn to create your own <h5> heading.

Try this example first:

<h5>Beautiful Hidden Spots</h5>

What To Do

✅ Type the code above into the editor below
✅ Click Test Code to check your answer
✅ You can change the text and try different ideas
✅ Add a <p> under your <h5> to describe your sub-section

Tip 💡

Use <h5> when you need to organise detailed information inside a subsection.
It keeps your content structured and professional, especially on long pages and tutorials.
Keep practising — every heading level helps you think like a real web developer! 🚀

HTML Editor

Live Preview

Next, explore how to use <h6> tags to add subtle subheadings to your pages.

Educodes Logo

© Copyright 2024. | Educodes