HTML rows attribute

rows attribute decides the height of the text area. rows attribute represents the number of lines.

Example

<!DOCTYPE html>
<html>
<body>
 <textarea cols="25" rows="9">
  It is textarea. It is editable and resizeable by default.But the size can be fixed. 
 </textarea>
</body>
</html>
Try </>

rows attribute value

The value of rows attribute is a valid positive integer. If the rows attribute is specified then that is the value otherwise it has '2' value.

Example

<textarea> Here the cols and rows attributes are not specified. But both cols and rows have 20 and 2 value respectively. </textarea>
Try </>

The height attribute may be used to define the height of the textual area.

Example

<textarea style="height:500px; width:500px;"> The height of textarea is specified by the height attribute. </textarea>
Try </>

Related Tags

<textarea> tag

The textarea supports the rows attribute.



Was this article helpful?

 

Email:

Message:

Get the newsletter