English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML 参考手册

HTML 标签大全

HTML: <textarea> cols 属性

cols属性指定文本区域的可见宽度。textarea的大小也可以通过CSS的height和width属性设置。

 HTML <textarea> Tag

在线示例

同时指定textarea的高度和宽度:

<textarea rows="4cols="5"
0">3At w
</textarea>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the cols attribute.

Definition and Usage

The cols attribute specifies the visible width of the text area.

Note:The size of the textarea can also be set with the CSS height and width properties.

HTML 4.01 with HTML5The difference

None.

Syntax

<textarea cols="number">

Attribute Value

ValueDescription
numberSpecify the width of the text area (in average character width units). The default value is20.
 HTML <textarea> Tag