English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
<hr> width attribute usage, the width attribute specifies the horizontal line width in pixels or percentages, online examples demonstrate how to use the <hr> width attribute, browser compatibility, syntax definition, and detailed information about its attribute values, etc.
Width is68% horizontal line:
<p>Normal hr horizontal line:</p> <hr> <p>hr horizontal line width68%:</p> <hr width="68%">Test and see ‹/›
IEFirefoxOperaChromeSafari
The width attribute has been deprecated, but it is still supported in all major browsers.
HTML5 The <hr> width attribute is not supported. Please use CSS instead.
In HTML 4.01 The <hr> tag's width attribute has been deprecated.
The width attribute specifies the width of the horizontal line in pixels or percentage units.
In HTML 4.01 In version 5, the <hr> tag's width attribute has been deprecated. Please use CSS instead.
CSS Syntax: <hr style="width:50%">
CSS Example: Set the width of <hr> element
In our CSS tutorial, you can find more aboutwidth attributedetails.
<hr width="pixels|%">
Value | Description |
---|---|
pixels | Specify the width in pixels (for example "100px" or simply "100"). |
% | Specify the width as a percentage of available space (for example "50%"). |