Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML hr width attribute

HTML
width property

HTML hr Tag Reference HTML


tag

Example

A horizontal rule with a width of 50%:


Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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


Definition and Usage

HTML5 does not support


The width attribute. Use CSS instead.

In HTML 4.01,


The width attribute is deprecated.

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


Compatibility notes

In HTML 4.01,


The width attribute is deprecated. Use CSS instead.

CSS syntax:


CSS example: setting


The width of the element

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


Syntax


HTML
tag