Set Size of Textarea Element Using CSS
In this we have to set the height and width of textarea by CSS properties either using inline CSS or external css.
Example: In this example, we are going to create a text area with height and width property of CSS.
HTML
<!DOCTYPE html> < html > < head > < style > textarea { height: 200px; width: 300px; } </ style > </ head > < body > < form action = "#" > < textarea name = "blog" >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