HR - Horizontal Rule

Syntax <HR>
Attribute Specifications
Contents Empty
Contained in , , , , , , , , , , , , , , , , , ,

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 or properties of . For example, the following style rule would suggest a horizontal line above all elements with CLASS=navbar:

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

HR's 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 property of 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 in favor of .

More Information