HTML hr width Attribute
HTML <hr> tag
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" />
In our CSS tutorial you can find more details about the
width property.
Syntax
Syntax Example
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.
Example
Source |
Output |
<hr width="50%" />
|
|
Try-It-Yourself Demos
hr width
attribute example
Set the width with the hr width attribute.
In CSS:
width example
Set the hr width with CSS.
HTML <hr> tag
 |

|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|