English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The use of the <hr> align attribute, the align attribute specifies the alignment of the horizontal line. Note: Unless the width attribute is set to less than100%, otherwise the align attribute is invalid.
Right-aligned horizontal line:
<hr align="right" width="50%"> <p>This is some text. This is some text. This is some text.</p>/p>Test to see ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the align attribute.
HTML5 The <hr> align attribute is not supported. Please use CSS instead.
In HTML 4.01 The align attribute of the <hr> element is deprecated.
The align attribute specifies the alignment of the horizontal line.
Note: Unless the width attribute is set to less than100%, otherwise the align attribute is invalid.
In HTML 4.01 In this case, the align attribute of <hr> is deprecated. Please use CSS instead.
CSS syntax (IE and Opera): <hr style="text-align:right">
CSS syntax (Firefox, Chrome, and Safari): <hr style="margin-right:0">
CSS syntax (cross-browser): <hr style="text-align:right;margin-right:0">
CSS Example: Align <hr> element
In our CSS tutorial, you can find more abouttext-align attributedetails.
<hr align="left|center|right">
Value | Description |
---|---|
left | Align horizontal line to the left. |
center | Align horizontal line to the center (default). |
right | Align horizontal line to the right. |