Quote:
Originally Posted by charleski
1 Centering horizontal rules
The attribute 'text-align' is not implemented for the hr tag, thus 'text-align: center' has no effect on a horizontal rule.
Workaround: set the left and/or right margin to half the width of the horizontal rule, e.g.:
Code:
hr {
width: 50%;
margin-left: 25%
}
|
I think this is slightly wrong. You need to set the margin to half the width of space left over by the horizontal rule. Eg, if you want a rule that's 70% of the page width, that leaves 30% remaining, so you'd set the left margin to half of that space, or 15%:
Code:
hr {
width: 70%;
margin-left: 15%
}