Easy Tutorial
❮ Att Optgroup Disabled Att Iframe Frameborder ❯

HTML <hr> width Attribute

HTML <hr> Tag

Example

A horizontal line with a width of 50%:


Browser Support

Although the width attribute is deprecated, it is still supported by all major browsers.


Definition and Usage

In HTML 4.01, the width attribute of <hr> is deprecated.

The width attribute specifies the width of the horizontal line, either in pixels or as a percentage.


Compatibility Notes

In HTML 4.01, the width attribute of <hr> is deprecated. Use CSS instead.

CSS syntax: <hr style="width:50%">

CSS Example: Setting the Width of an <hr> Element

In our CSS tutorial, you can find more details about the width property.


Syntax

Attribute Values

Value Description
pixels Specifies the width in pixels (e.g., "100px" or simply "100").
% Specifies the width as a percentage of the available space (e.g., "50%").

❮ Att Optgroup Disabled Att Iframe Frameborder ❯