HTML <hr> widthAttributes
Browser Support
![]()
![]()
![]()
![]()
![]()
Although the width attribute is deprecated, it is still supported by all major browsers.
Definition and Usage
HTML5 does not support the <hr> width attribute. Use CSS instead.
In HTML 4.01, the width attribute of <hr>is deprecated。
The width attribute specifies the width of the horizontal rule, in pixels or percentages.
Compatibility Notes
In HTML 4.01, the width attribute of <hr> is deprecated. Use CSS instead.
CSS syntax: <hr style="width:50%">
CSS Example: Set the width of the <hr> element
In our CSS tutorial, you can find more aboutwidth attributedetails.
Syntax
<hr width="pixels|%">
Attribute Values
| Value | Description |
|---|---|
| pixels | Specifies the width in pixels (e.g. "100px" or just "100"). |
| % | Specifies the width as a percentage of available space (e.g. "50%"). |
HTML <hr> Tag Other Extensions