HTML

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

Apr 30, 2025, 6:06 AM
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.