width (HTML attribute)
Example
<p>And with that the actress explained to the bishop, through a series of hand gestures, that she was in fact mute and could not possibly have said what she was reported to have done.</p> <hr color="red" size="10" width="50%" /> <div id="footer">© All content copyright 2007. Even the unfunny stuff.</div>
The image below shows a horizontal rule set at 50% - the red border is added only to show scale.

Description
The width
attribute affects the hr element’s width in pixels (or
percentage, if % symbol included); if no width is specified, the
hr will take up 100% of its containing element.
Value
A number wrapped in quotes (which is understood and rendered as pixels on screen no need to specify unit of measurement, as per example above) or percentage figure.
Compatibility
| IE | 5.5 | Full |
|---|---|---|
| 6.0 | Full | |
| 7.0 | Full | |
| Firefox | 1.0 | Full |
| 1.5 | Full | |
| 2.0 | Full | |
| Safari | 1.3 | Full |
| 2.0 | Full | |
| 3.0 | Full | |
| Opera | 9.2 | Full |
| 9.5 | Full |
The
width attribute is well supported but as a
deprecated (presentational) attribute, it should not be
used.
User-contributed notes
There are no comments yet.
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

