Set Size of Textarea Element Using HTML
We can set the size for the text area using HTML by using rows and columns. rows*columns will be the size of the text area.
Example: In this example, we are going to create a text area with 4 rows and 7 columns.
HTML
<!DOCTYPE html> < html > < body > < form action = "#" > < textarea name = "blog" rows = "5" cols = "15" >Hi Geek</ textarea > < br > < input type = "submit" value = "submit" > </ form > </ body > </ html > |
Output:
How to set the size of textarea in HTML ?
In this article, we will discuss how to set the size of the textarea in HTML. The <textarea> tag in HTML defines a multi-line plain-text editing control. A text space will hold an infinite range of characters, and therefore the text renders in a set-width font (usually Courier).
In the below code you can check the textarea size is not set yet.
HTML
<!DOCTYPE html> < html > < body > < form action = "#" > < textarea name = "blog" >Hi Geek</ textarea > < br > < input type = "submit" value = "submit" > </ form > </ body > </ html > |
Table of Content
- Set Size of Textarea Element Using HTML
- Set Size of Textarea Element Using CSS