Learn HTML – Part 9 – Horizontal Line Tag – hr Tag Explained
The HTML hr tag is used to create a horizontal line that visually separates sections of content on a webpage.
It helps organize information and improves the readability of long pages.
What is the hr Tag?
The hr tag stands for Horizontal Rule. It represents a thematic break between sections of content.
Browsers usually display it as a horizontal line across the page.
The hr tag is a self-closing tag, which means it does not require a closing tag.
Basic Syntax
<hr>
This simple tag creates a horizontal line on the page.
Example – Separating Content Sections
<h2>Introduction</h2>
<p>HTML is the foundation of web development.</p>
<hr>
<h2>Next Section</h2>
<p>CSS is used to style web pages.</p>
Output:
Introduction
HTML is the foundation of web development.
Next Section
CSS is used to style web pages.
When Should You Use the hr Tag?
- To separate sections of content
- To indicate a change of topic
- To visually divide page elements
The
hrtag represents a thematic break in content, not just a decorative line.
Common Mistakes Beginners Make
- Using multiple
hrtags for layout spacing - Using it purely for design instead of meaning
- Trying to close the tag like
</hr>
Conclusion
The HTML hr tag is used to create horizontal lines that separate sections of content.
It improves content organization and helps users visually understand page structure.
What’s Next?
Now that you understand the hr tag, the next step is learning about the strong tag, which is used to emphasize important text.
Next: Learn HTML – Part 10 – strong Tag – Emphasize Important Text →
Series: Learn HTML Series
