HTML
width 属性
标签实例
带有 30 个字符宽度的预格式化文本:
文本在pre标签中指定了宽度 文本包含了空格 和 换行Try it »
Browser Support
Only Firefox browser supports the width attribute.
Definition and Usage
HTML5 does not support
width 属性。请使用 CSS 代替。在 HTML 4.01 中,
的 width 属性 已废弃。width 属性Specifies每行的最大字符数。
兼容性注释
在 HTML 4.01 中,
的 width 属性已废弃。请使用 CSS 代替。CSS Syntax:
Some textCSS Example: Preformatted text with a fixed width
In our CSS tutorial, you can find more about width attribute details.
**Tip:** If the text is wider than the surrounding element, the overflow property adds a scrollbar.
Syntax
## Attribute value | Value | Description | | --- | --- | | *number* | 设置以字符数为单位的宽度。 | ---  HTML标签
HTML 



