HTML <br> and <hr> Tags Explained with Examples and Best Practices

Himmat Kumar Apr 8, 2025, 8:04 PM
HTML
Views 1807
Blog Thumbnail

🧾 Using Breaks and Horizontal Rules in HTML

In HTML, a line break can be added using the <br> tag and a horizontal line can be created using the <hr> tag.

🔹 Line Break (<br>)

The <br> tag breaks a line but it doesn't start a new paragraph.

This is line one.
This is line two.

🔸 Example: Breaking a line manually using <br>

🔹 Horizontal Rule (<hr>)

The <hr> tag creates a line that can be used for dividing the content or formatting it based on styling preference.

Content above the line.

Content below the line.

🔸 Example: Visual separation using <hr>

❌ Common Mistakes

<br> is overused to control a part of layout. It should have space above and below the paragraph that can be added using CSS margin/padding.
<hr> is used just for decorating purposes without meaning it.

⚠️ Use these tags semantically and not for layout or design hacks.

🎨 Styling with Tailwind

Using Tailwind makes styling <hr> easier without changing the look in any way.

<hr class="my-6 border-t border-gray-300" />

⚊ Adds spacing and a styled horizontal rule.

📌 Best Practices

  • Do not use <br> often. It should only be used with examples like poems or addresses.
  • Use <hr> for indicating breaks, but never for decoration.
  • Using CSS/Tailwind, improve the visual styling of these tags for better readability.

Comments

Please login to leave a comment.

No comments yet.

Related Posts

html-seo-faq-2025
1446 viewsHTML
Himmat Regar Jun 23, 2025, 4:41 PM

HTML & SEO FAQ 2025: Answers to the Web’s Most-Asked Qu...

what-is-html-full-explanation
729 viewsHTML
Himmat Kumar Oct 13, 2023, 11:40 PM

What is HTML? Full Explanation and Guide

comments-in-html
1483 viewsHTML
Himmat Kumar Apr 10, 2025, 11:19 AM

Comments in HTML – Guide with Examples

html-css-js-online-compiler
579 viewsHTML
Himmat Regar May 30, 2025, 6:54 AM

HTML CSS JS Online Compiler – Best Free Tools to Code a...

html-lists-and-links-guide
1675 viewsHTML
Himmat Regar Jun 2, 2025, 6:38 PM

HTML Lists & Links Guide – Correct Markup, Accessibilit...

html-superscript-subscript-guide
1277 viewsHTML
Himmat Regar Jun 9, 2025, 5:02 PM

Mastering Superscript & Subscript in HTML: A Complete H...

semantic-html-complete-guide
1727 viewsHTML
Himmat Regar Jun 9, 2025, 5:37 PM

Semantic HTML Explained: Why <header>-<footer> & Friend...

hyperlinks-and-media-embedding-2025
1478 viewsHTML
Himmat Regar Jun 23, 2025, 4:37 PM

Hyperlinks & Media: Embedding Content the Right Way in ...

understanding-html-elements
521 viewsHTML
Himmat Kumar Jul 25, 2024, 1:09 PM

Understanding HTML Elements

responsive-meta-seo-friendly-markup-2025
1149 viewsHTML
Himmat Regar Jun 23, 2025, 4:23 PM

Mastering Responsive Meta & SEO-Friendly Markup in 2025