| In addition to using the Heading <h#> tag to show how your page is divided in sections, another useful tool is the Horizontal Rule, made with the <hr> tag. |
The <hr> tag, when used without any attributes will typically place a 3 pixel thick shaded line across the width of the browser window.
|
| The width attribute may be used to set the width of the bar, using either a percentage of the browser window or a fixed pixel size. |
This hr will extend across 50% of the window.
<hr width="50%">
While this hr will extend 50 pixels.
<hr width="50"> |
This hr will extend across 50% of the window.
While this hr will extend 50 pixels.
|
| You will notice that, by default, the rule is aligned in the center of the window. This may be controlled by using the align attribute in the <hr> tag. This will work exactly like the align attribute that we saw earlier in the <p> tag. |
<hr width="50%" align="left">
<hr width="50%" align="center">
<hr width="50%" align="right"> |
|
| The size of the bar may also be set by using the size attribute. This sets the size of the bar in pixels. |
<hr width="50%" align="left" size="5">
<hr width="50%" align="left" size="10">
<hr width="50%" align="left" size="20"> |
|
| Suggested uses of the <hr> tag are to divide the sections of your content, to set apart your navigational features from your content and to mark the beginning and ending of forms. |
|
|
|
|
|
| With the <hr> tag, we gain another way of setting apart sections of our page. We have good control over the appearance throough the use of the width, align and size attributes. |
| In the next section, we will look at a way to point to another file on the web. This will help us to add images to our pages and to make links to othere web sites. |
|
|