3.4. Horizontal Rules

Horizontal rules appear as lines across the user agent screen, and they are generally used to separate information visually. A typical <hr/> is shown in Figure 3-4.

The tag to generate a horizontal rule is <hr />. Like any other nonpaired tag, the <hr /> tag should include a slash so that it operates as an open and close tag.

Previous versions of HTML included various attributes that could be used to modify the width, thickness, and look of the line. These attributes have been deprecated in favor of applicable styles.

You will learn more about styles in Part II of this book. Figure 3-5 shows a few sample rules using different styles.

Figure 3-4. Figure 3-4
Figure 3-5. Figure 3-5

Get Web Standards Programmer's Reference: HTML, CSS, JavaScript®, Perl, Python®, and PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.