HTML hr width Attribute

Definition and Usage

The width attribute specifies width of the hr (horizontal ruler) element.

Compatibility Notes

The width 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: <hr style="width:10px" />


<hr width="size" />

Syntax Example

<hr width="50%" />

Attribute Values

Value Description
pixels Length in pixels (like "100px", or just "100").
percent Length in percent of the available space (like "20%").

Browser Support

The attribute is deprecated, but still supported in all major browsers.


Source Output
<hr width="50%" />

HTML hr width Attribute Reviewed by 1000sourcecodes on 03:00 Rating: 5
Powered by Blogger.