text-align: ***; margin-***: ***;
Browser |
|
---|
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 Chrome, Safari, 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 left |
right | aligns to the right | |
margin-left | 0 | aligns to the left |
margin-right | 0 | aligns to the right |