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

Himmat Kumar Apr 8, 2025, 8:04 PM
HTML
Views 2609
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

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

Comments in HTML – Guide with Examples

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

Mastering Responsive Meta & SEO-Friendly Markup in 2025

html-forms-complete-guide
1750 viewsHTML
Himmat Regar Jun 9, 2025, 5:20 PM

The Ultimate Guide to HTML Forms: Inputs, Select Menus,...

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

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

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

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

html-paragraph-tag-guide
2021 viewsHTML
Himmat Kumar Apr 8, 2025, 1:50 PM

HTML Paragraph Tag – Complete Guide with Examples

glassmorphism-login-form
1161 viewsHTML
Himmat Kumar Mar 4, 2025, 1:15 AM

Glassmorphism Login Form: A Modern Design Tutorial

getting-started-with-html-setup-edit-run-code-in-browser
1141 viewsHTML
Himmat Kumar Jul 25, 2024, 1:09 PM

Getting Started with HTML: Setup, Edit, and Run Your Co...

modern-login-form-html-css
994 viewsHTML
Himmat Kumar Mar 4, 2025, 12:57 AM

Creating a Modern Login Form with HTML & CSS

html-tags
1248 viewsHTML
Himmat Kumar Oct 19, 2023, 2:45 AM

HTML Tags