Why Horizontal Rules used? - HTML

Horizontal rules are used to visually break up sections of a document. The <hr> tag creates a line from the current position in the document to the right margin and breaks the line accordingly. For example, if you were reproducing text from a book, you might want to use rules to show a break between chapters, as shown in the following excerpt from Anna Sewell’s Black Beauty:

The output of this code is shown in Figure.

The <hr> tag inserts a horizontal rule in the document.

tag inserts a horizontal rule in the document

As with most tags, you can customize the look of the <hr> tag by using styles. For example, consider the following style:

If this style were added to our last example, the results would be similar to the output shown in Figure.

You can control various aspects of the horizontal rule, including its width, its thickness (height), and the color.

You can control various aspects of the horizontal rule, including its width, its thickness (height), and the color.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

HTML Topics