HR
The HR attributes of align, noshade, size and width
have been deprecated in favor of style sheets.
Deprecated Examples:
The deprecated attributes specified the following values:
align = left|center|right
- left: the rule is rendered flush left.
- center: the rule is centered.
- right: the rule is rendered flush right.
These attributes may now be specified using Style Sheets. The
following example displays both the deprecated method and the
CSS method.
<HR align = right
width = "200"
size = "10"
noshade
>
Notice in the CSS example (below), a color may now be specified
for the Horizontal Rule. Another difference is that
the size attribute has been clarified by being
termed the height attribute. The alignment is
now specified as a distance from the left edge rather
than simply justifying the line right, centered, or left.
CSS Example:
<STYLE TYPE="text/css">
HR {color: red;
width:200;
height: 10px;
margin-left: 370px;
}
</STYLE>
The use of the width property, coupled with the margin-left
property gives us greater flexibility in placing the line on
on the page. Suppose you didn't want the line completely
moved over to the right, and didn't want it centered, but
rather somewhere in between. By adjusting the margin-left
value, you could achieve this effect.
<STYLE TYPE="text/css">
HR {color: red;
width:200px;
height: 5px;
margin-left: 250px;
}
</STYLE>
At the time of writing, the latest version of
this browser
rendered the preceding examples well, while the latest version of
this browser did not.
Technically, HR is a block element and as such, we should
be able to use float: right to align the rule, but it is
not dependable, allowing the rule to justify left in some
browsers.
ADDITIONAL RESOURCES
Breaks
HTML 4.01 Tags
|