HTML hr width attribute
Browser Support
Although the width attribute is obsolete, but the property still get the support of all major browsers.
Definition and Usage
HTML5 does not support the <hr> width attribute. Use CSS instead.
In HTML 4.01, <hr> The width attribute obsolete .
horizontal width attribute specifies the width in pixels or percentage.
Compatibility Notes
In HTML 4.01, <hr> The width attribute is deprecated. Use CSS instead.
CSS Syntax: <hr style = "width: 50%">
Width setting <hr> element: CSS Examples
In our CSS tutorial you can find more information about the width attribute details.
grammar
<hr width="pixels|%">
Property Value
值 | 描述 |
---|---|
pixels | 规定以像素计的宽度(比如 "100px" 或者只是是 "100")。 |
% | 规定以可用空间的百分比计的宽度(比如 "50%")。 |
HTML <hr> tag