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.
Suche
Kategorien
Mehr lesen
Technology
The VLOOKUP function in Excel
The VLOOKUP function in Excel is used to search for a value in the first column of a table and...
Von Microsoft Excel Tips 2024-10-16 00:58:30 0 15KB
Technology
Popular Linux Distributions
Linux distributions, or distros, come in various forms tailored to different user needs, ranging...
Von Tebtalks Access 2024-07-13 07:29:49 0 9KB
Chemistry
S.4 CHEMISTRY WAKATA PRE MOCK QUESTIONS 2
https://acrobat.adobe.com/id/urn:aaid:sc:EU:85bd6cfc-45b5-4737-b430-d0e1fce698e9
Von Landus Mumbere Expedito 2024-07-19 23:27:53 0 9KB
Physics
weve-been-misreading-a-major-law-of-physics-for-300-years
https://www.sciencealert.com/weve-been-misreading-a-major-law-of-physics-for-300-years
Von Landus Mumbere Expedito 2024-11-03 04:28:05 0 15KB
Biology
CBTI UCE BIOLOGY MOCK EXAM PAPER 1
CBTI UCE BIOLOGY MOCK EXAM PAPER 1
Von Landus Mumbere Expedito 2024-07-30 12:40:47 0 10KB
Tebtalks https://tebtalks.com