HORIZONTAL RULES

Horizontal rules are useful to separate sections of your web pages. They are also used as decorative touches at the top and bottom of some pages. You have control over many aspects of their appearance. You can control their size (thickness), how wide they are, their color, whether or not they have a 3d look to them, and their alignment on the page.

The HTML code needed to create horizontal rules is the <HR> tag. It is not a container tag (so there is no </HR> tag). You control its appearance by setting various attributes:

This is a simple rule create with an unmodified <HR> tag:



WIDTH= sets the horizontal width of the rule. This can be given as a number of pixels, or as a percent of the user's screen width.





SIZE= sets the vertical thickness of the rule, in pixels. The default value of 2 is also the minimum value.





ALIGN= sets the horizontal alignment of the rule. The default is centered, but it can be set to "left" or "right" as well.




COLOR= allows you to set the color of the rule (only works in MS Internet Explorer); doing so appears to sacrifice the 3D shading of the rule.






NOSHADE allows you to turn off the shading and achieve a solid rule without setting the color



As you might imagine, combining these tags can give you a lot of flexibility in the appearance of the horizontal rules, and thus a lot of potential uses for them.