Easy Tutorial
❮ Canvas Putimagedata Att Col Span ❯

HTML <hr> align Attribute

HTML <hr> Tag

Example

Left-aligned horizontal line:


Browser Support

All major browsers support the align attribute.


Definition and Usage

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

The align attribute specifies the alignment of the horizontal line.

Note: The align attribute will have no effect unless the width attribute is set to less than 100%.


Compatibility Notes

In HTML 4.01, the align attribute of <hr> 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: Aligning <hr> Element

In our CSS tutorial, you can find more details about the text-align property.


Syntax

Attribute Values

Value Description
left Left-aligns the horizontal line.
center Center-aligns the horizontal line (default).
right Right-aligns the horizontal line.

❮ Canvas Putimagedata Att Col Span ❯