Horizontal Rule Element and the Border Property

Horizontal Rule Element

The hr element is an HTML element used to divide the page into sections; this typically creates a line across the page. There are depreciated attributes for this element. This is a void element.

<hr>

Border Property

In CSS ALL elements are considered to be boxes (refer to the box model discussion). Elements typically have borders, which are simply lines around the elements. The width, style, and color of borders can be altered; in addition, borders can be placed around a single side of an element. This is often considered a more modern approach to the horizontal rule element.

Consider a paragraph with a border placed at the bottom. The effect is the same as using a horizontal rule; but there are more options for configuring appearance.

p {border: thin solid black;}

The thickness of a border

Multiple styles are possible: