alignment of the horizontal rule


text-align: ***; margin-***: ***;

Browser
Internet Explorer Firefox Opera

The text-align property sets the text horizontal alignment, and the margin property sets the margins of an element.

For MSIE and Opera
The alignment of the horizontal rule can be specified by applying the text-align property to the HR element.

For Firefox
The alignment of the horizontal rule can be specified by applying the margin property to the HR element.


hr {
width: 50%;
text-align: right;
margin-right: 0;
}


Property Value Explanation
text-align left aligns to the leftInternet ExplorerOpera
right aligns to the rightInternet ExplorerOpera
margin-left 0 aligns to the leftFirefox
margin-right 0 aligns to the rightFirefox

Example

<html>
<head>
<title>TAG index</title>

<style type="text/css">

hr {
width: 50%;
}

hr.left {
text-align: left;
margin-left: 0;
}

hr.right {
text-align: right;
margin-right: 0;
}

</style>

</head>
<body>

<hr>

<hr class="left">

<hr class="right">

</body>
</html>
Output