HTML cols Attribute

HTML cols Attribute: The HTML cols attribute defines how many width average width characters should fit on a single line. The size of a textarea can also be set by the CSS height and width properties. Here the number specifies the width of the text area. The default value is 20.

HTML cols Attribute

The HTML cols attribute can be applied on the <textarea> element.

Syntax:<textarea cols = “value”>Text content…</textarea>



Browser Support

The HTML cols attribute is supported by the following browsers:

  • Chrome
  • Firefox
  • Opera
  • Safari
  • Internet Explorer

Example: for cols attribute

<!DOCTYPE html>
<html>
<body>
<textarea rows="4" cols="50">
FreshersNow.Com is one of the best job sites in India for freshers. In this website, we provide latest job updates for freshers and experienced professionals.
</textarea>
</body>
</html>

Output:

 

HTML cols attribute