Learn HTML – Part 9 – Horizontal Line Tag

Understanding the <hr> Tag in HTML (Horizontal Line Tag)

The <hr> tag is used to insert a horizontal rule (line) across the page, often to indicate a thematic break in content or a shift in topic. It is a self-closing tag and does not require an end tag.

Tag Syntax:

<hr>

Common Uses:

  • Visually separating sections of content
  • Indicating transitions or breaks in narrative flow
  • Styling page dividers with CSS

Custom Styling (Optional):

<hr style="border: 1px solid #ccc;">

Important Notes:

  • The default appearance of <hr> may vary by browser.
  • You can fully style <hr> with CSS (thickness, color, margin, width, etc.)
  • It should not be used just for decoration—use it for semantic breaks.

Example:

<p>This is the first section of the content.</p>
<hr>
<p>This is the next section after a horizontal line.</p>

Workbook:

Facebook
WhatsApp
Twitter
LinkedIn
Pinterest

Leave a Comment

Your email address will not be published. Required fields are marked *

About Author
Willaim Wright

Voluptas feugiat illo occaecat egestas modi tempora facilis, quisquam ultrices.

Scroll to Top