HTML hr align Attribute
HTML <hr> tag
Definition and Usage
The align attribute specifies horizontal alignment of the hr (horizontal
ruler) element.
This attribute does not have any effect unless the width is
less than 100%.
Compatibility Notes
The align attribute of the hr element was deprecated in HTML 4.01
and is not supported in XHTML 1.0 Strict DTD.
Use CSS instead.
CSS syntax for IE and Opera: <hr style="text-align:right" />
CSS syntax for Firefox: <hr style="margin-right:0" />
For cross-browser syntax use both: <hr style="text-align:right;margin-right:0"
/>
In our CSS tutorial you can find more details about the
text-align property.
Syntax
Syntax Example
Attribute Values
Value |
Description |
center |
Default. Center-align the horizontal ruler. |
left |
Left-align the horizontal ruler. |
right |
Right-align the horizontal ruler. |
Browser Support

The attribute is deprecated, but still supported in all major browsers.
Example
Source |
Output |
<hr style="width:50%" align="left" />
|
|
Try-It-Yourself Demos
hr align
attribute example
Set the hr alignment with the hr align attribute.
In CSS: hr
alignment example
Set the hr alignment with CSS.
HTML <hr> tag
 |

|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|