HTML <textarea> colsAttribute
Examples
A text area with a specified height and width:
<textarea rows="4" cols="50">
At example.com you will learn how to create a website. We provide all free Web development tutorials.
</textarea>
At example.com you will learn how to create a website. We provide all free Web development tutorials.
</textarea>
Try it yourself »
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the cols attribute.
Definition and Usage
The cols attribute specifies the visible width of a text area.
Note:The size of a textarea can also be set by the height and width attributes of CSS.
Differences between HTML 4.01 and HTML5
None.
Syntax
<textarea cols="number">
Attribute Values
| Value | Description |
|---|---|
| number | Specifies the width of the text area (in average character widths). The default value is 20. |
HTML <textarea> Tag Other Extensions