The Web Design Group

hr - Horizontal Rule

Syntax <hr />
Attribute Specifications
Contents Empty
Contained in applet, blockquote, body, button, center, dd, del, div, fieldset, form, iframe, ins, li, map, noframes, noscript, object, td, th

The hr element defines a horizontal rule for visual browsers. While this element is inherently presentational, it can be used structurally as a section divider. However, for greater flexibility the hr element can be replaced with the border-bottom or border-top properties of Cascading Style Sheets. For example, the following style rule would suggest a horizontal line above all div elements with class="navbar":

div.navbar { border-top: solid medium navy }

hr's deprecated align attribute suggests the horizontal alignment of the line. Possible values are left, right, and center. The deprecated width attribute specifies the width of the line as a percentage or a number of pixels. If a width is specified, percentages are generally preferred since they adjust to varying window sizes. The width property of Cascading Style Sheets provides greater flexibility in suggesting the width of horizontal rules.

The boolean noshade attribute suggests that the rule be rendered as a solid line rather than the groove style commonly used. The size attribute suggests the height of the line in pixels. These attributes are both deprecated in favor of style sheets.

More Information