HTML Horizontal Rules (<hr>)

0
2K

The <hr> tag represents a thematic break in a page, typically displayed as a horizontal rule. It separates content into distinct sections.

Basic Usage

HTML
<hr>

Example with Other Elements

HTML
<h1>Section 1</h1>
<p>Content for section 1.</p>

<hr>

<h1>Section 2</h1>
<p>Content for section 2.</p>

Attributes

While the <hr> tag doesn't have many attributes, here are the ones you might use:

  • width: Specifies the width of the rule.
  • size: Specifies the height of the rule.
  • align: Specifies the alignment of the rule (left, right, or center).
  • noshade: Specifies that the rule should not be shaded.

Note: The appearance of the <hr> element can be heavily customized using CSS.

Example with Attributes

HTML
<hr width="50%" size="5" align="center" noshade>

Important Points

  • Semantic meaning: The <hr> tag has a semantic meaning, indicating a thematic break.
  • Visual appearance: While traditionally displayed as a horizontal line, its appearance can vary based on user styles or browser settings.
  • Accessibility: The <hr> tag provides a visual cue for screen reader users, helping them understand the structure of the page.

When to Use <hr>

  • To separate content into distinct sections.
  • To indicate a change in topic or mood.
  • To visually break up long sections of text.
Search
Categories
Read More
Technology
Scenarios of Computer Misuse and Their Effects on Society
Computer misuse can have widespread and serious impacts on society. It encompasses a wide range...
By ALAGAI AUGUSTEN 2024-07-13 07:42:14 0 2K
Computer Programming
Constructors, Interfaces, and Memory
While Python has some similarities to other languages regarding these concepts, it also has some...
Technology
Financial Theft
Financial Theft involves the unlawful acquisition of money, assets, or financial information...
By ALAGAI AUGUSTEN 2024-07-13 17:26:52 0 3K
Technology
Computer Netwrks
A computer network is a collection of interconnected devices that share resources and...
By Mpatswe Francis 2024-10-03 23:03:52 0 2K
Other
Know Your Worth, Control Your Emotions, and Never Settle
In a world that often pushes us to conform, understanding your value, mastering your emotions,...
By ALAGAI AUGUSTEN 2024-08-14 05:42:34 0 2K