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%" />

Share this article :
Copyright © 2012. Best Online Tutorials | Source codes | Programming Languages - All Rights Reserved