Horizontal RulesThe Default Horizontal RuleThe HTML for a Horizontal Rule is about as simple as HTML gets. Here's how the simple <HR> horizontal rule appears: Specify the Height of a Horizontal RuleYou can specify the height of the horizontal rule in pixels. The HTML the examples below are <HR SIZE=2>,
<HR SIZE=5>, <HR SIZE=10>, <HR SIZE=30> Specify the Pixel Width of a Horizontal RuleYou can specify the width across the page for a horizontal rule in pixels. The HTML is <HR WIDTH=100>, as in the first example below. The following examples have a width of 200, 300, and 500 pixels. Specify the Percentage Width of a Horizontal RuleYou can specify the width of the horizontal rule as a percentage of the screen's width. This is useful, since you never know what resolution a visitor to your web site is viewing your web site is using. The HTML for the examples below are <HR WIDTH=25%>, Aligning the Horizontal RuleYou can align the horizontal rule as you can with the IMG SRC tag, by including the ALIGN=LEFT, ALIGN=RIGHT, or ALIGN=CENTER. The HTML for the examples below : Specifing No Shade on the Horizontal RuleYou can specify no shading on the horizontal rule:
Adding Color to a Horizontal RuleNote: You loose the shading on the Horizontal Rule when you add color. Note Number 2: Netscape does not yet support colored horizontal rules.
View Horizontal Rules on Different Backgrounds:
|