HTML
width property
tag
Example
A horizontal rule with a width of 50%:
Try it »
Browser support





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:
The width of the element
In our CSS tutorial, you can find more details about width propertydetails.
Syntax
HTML
tag
HTML