How to Format Text Inside a Text Area
A "text area" in HTML is the element of a web page that a visitor can type text into. Unlimited characters can be typed into a text area so they are typically used for commenting areas, for contact forms or for entering addresses. Different web browsers display text areas differently. You can use Cascading Style Sheets (CSS) to control the look and feel of a text area, such as the font, size and color.
Instructions
-
-
1
Create a CSS file if you don't already have one. For this example, "style.css" will be the CSS file.
-
2
Open your style.css file in the HTML or text editor of your choice.
-
-
3
Add the following code somewhere in your style.css file:
textarea#style {
font-family: Tahoma, sans-serif;
font-weight: bold;
}
This will change the font and font weight of any text typed into your text area. You can use any font HTML elements you'd like.
-
4
Save the style.css file.
-
5
Add the following code between the <head> and </head> tags of your web page, then save it:
<link rel='stylesheet' type='text/css' media='all' href='style.css' />
-
6
View your web page in a browser to see the changes.
-
1
References
Resources
- Photo Credit Stockbyte/Stockbyte/Getty Images