HTML textarea cols Attribute

How to create a textarea with specific width in html

Posted by Raquel Crist on December 19, 2022

HTML textarea cols Attribute

How to create a textarea with specific width in html

Posted by Raquel Crist on December 19, 2022

In HTML, the col attribute is used to set the width of the textarea.

It is used to show the number of visible lines of text displayed vertically in the textarea.

You will also see the width difference based on the number of cols specified.

If the col attribute is not used the default value is 20.

Here is an example below:

<textarea cols="35">
Wecode101 is a platform for short coding tutorials
</textarea>

 

Any question?
This field is required
Your question have been successfully submitted and will be reviewed before published
Please login to ask a question