XML technologies / HTML & XHTML / Alphabetical list of HTML and XHTML elements / hr

(Excerpt from "HTML & XHTML ─ kurz & gut" by Jennifer Niederst Robbins)

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

   

hr

HTML 4.01 | HTML 5

HTML: <hr>; XHTML: <hr/> or <hr />

Inserts a horizontal rule into the document to visually separate sections of the page. hr is a block element.

Notes

This is one of the few remaining presentational HTML elements. HTML 5 still includes hr, but redefines it as a thematic break at paragraph level. Developers using horizontal rules only for decoration should use stylesheets instead. The CSS property border makes it easy to create horizontal lines along the top or bottom edges of elements.

Start/end tag

This is an empty element. HTML forbids an end tag. In XHTML, the element must end with a slash before the closing angle bracket. Developers can insert a space before the slash to improve backward compatibility with older browsers.

Attributes

Core, internationalization, events, global HTML 5 attributes

  • align="center|left|right"

    Deprecated. Not in HTML 5. If the rule is narrower than the window, this attribute controls its horizontal alignment.

  • noshade (noshade="noshade" in XHTML)

    Deprecated. Not in HTML 5. Displays the rule as a solid line without shading.

  • size="Zahl"

    Deprecated. Not in HTML 5. Specifies the rule’s thickness in pixels.

  • width="Zahl oder Prozentwert"

    Deprecated. Not in HTML 5. Specifies the rule’s length in pixels or as a percentage of the page or containing element’s width.

Example (HTML)

<p>Dies sind die Hinweise von Donnerstag.</p>
<hr>
<p>Dies sind die Hinweise von Freitag.</p>

Example (XHTML)

<p>Dies sind die Hinweise von Donnerstag.</p>
<hr />
<p>Dies sind die Hinweise von Freitag.</p>

 

> back to the alphabetical list of elements

   

 

 

 

back to top