Confused? This is just one more option for creating fancy
dividers to mark the different sections of a web page.
After this lesson you will be able to:
Note: We will not be modifying our web pages in this lesson -- so you can just review the information and then decide if you want to experiment with it. You may want to first look at the test page to see if your browser supports the tags used in this lesson.
Netscape's first HTML "extensions" (or "deviations from standards") offered some more formatting options for the <hr> tag (Horizontal Rule) -- see lesson 4). By default, the Netscape browser displayed the solid line separator with a three-dimensional, shaded look rather then the solid line as implemented in previous web browsers.
The first option is to allow for lines of different thicknesses by using the option:
where N is the thickness of the line in pixels. Let's look at some examples to show the effect.
<hr size=2> same as <hr> :
<hr size=8> :
<hr size=20> :
Another formatting option for the <hr> tag allows you to adjust the width of the line -- it does not necessarily have to stretch across the whole page. You can do this by using this format:
<hr width=X> <hr width=Z%>
where X is a number of pixels for the width and Z is the percentage of the current web page. In general we recommend using the percentage as it will adjust itself to the width of the browser window used by the person reading your pages (some out there are using 2-page high resolution monitors while others are squinting into their 13" screen).
Here are some examples (see how we include the size tag as well):
<hr width=80 size=10> :
<hr width=80% size=10> :
NOTE: Try stretching and/or shrinking the width of your web browser window to see the difference between specifying the width in absolute pixels (width=80) compared to specifying the width in percentage of the web page (width=80%)
<hr width=40% size=10> :
<hr width=5% size=10> :
Finally, there may be a case where you do not want the 3D shading on the <hr> tag. It is as simple as:
<hr width=60% size=6 noshade> :
<hr width=60% size=1 noshade> :
Review topics for this lesson:
Experiment with some of the <hr> options in your own web pages.
Move it to the left... no! to the right... no! to the center...
Writing HTML: Lesson 19: Easy Horizontal Rules
©1994-2002 Maricopa Center for Learning and Instruction (MCLI)
Maricopa Community Colleges
Questions? Comments? Visit our feedback center
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 2.5 License.