HTML Horizontal Rules (<hr>)

0
8KB

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.
Rechercher
Catégories
Lire la suite
Computer Programming
Italic Text in HTML: <i> and <em>
To make text italic in HTML, you can use either the <i> or <em> element. Both...
Par HTML PROGRAMMING LANGUAGE 2024-08-29 01:53:32 0 8KB
Mathematics
UACE MATHS 1 WAKISSHA MARKING GUIDE
UACE MATHS 1 WAKISSHA MARKING GUIDE
Par Landus Mumbere Expedito 2024-08-10 10:14:06 0 10KB
Mathematics
EXCEL IN ADVANCED LEVEL MATHEMATICS
EXCEL IN MATHS NOTES
Par Landus Mumbere Expedito 2024-07-29 19:08:00 0 11KB
Physics
MATIGO PHYSICS PAPER 1 2024
MATIGO UACE PHYSICS PAPER 1 2024
Par Question Bank 2024-09-05 17:26:27 0 14KB
Autre
I Am Fixing Myself Because I Understand I Am the Problem Too
In a world that often encourages us to seek external causes for our difficulties, embracing the...
Par ALAGAI AUGUSTEN 2024-08-15 17:13:23 0 10KB
Talksphare https://talksphare.com