Latest web development tutorials

HTML hr align property

HTML hr tag Reference Manual HTML <hr> tag

Examples

Left horizontal line:

<p>这是一些文本。这是一些文本。这是一些文本。</p>

<hr align="left" width="50%">

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support align attribute.


Definition and Usage

HTML5 does not support the <hr> align attribute. Use CSS instead.

In HTML 4.01, <hr> The align attribute is deprecated .

align attribute specifies the horizontal alignment.

Note: Unless the width attribute is set to no effect less than 100%, otherwise align property does not have.


Compatibility Notes

In HTML 4.01, <hr> The align attribute is deprecated. 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 information about the text-align attribute details.


grammar

<hr align="left|center|right">

Property Value

描述
left 左对齐水平线。
center 居中对齐水平线(默认值)。
right 右对齐水平线。


HTML hr tag Reference Manual HTML <hr> tag