color of text in a form field


color: ***;

Browser
Internet Explorer Firefox Opera

The color property specifies the text color.

The color of text in the form fields can be specified by applying this property to the INPUT, TEXTAREA, and SELECT elements.


input, select, textarea {
color: red;
}


Property Value Explanation
color color code or name text color

In selectable list, the text color for the one list item can be specified by applying this property to the OPTION element.


Example

<html>
<head>
<title>TAG index</title>

<style type="text/css">

textarea {
width: 300px;
height: 7em;
}

input, select, textarea {
color: red;
}
#example {
color: #0000ff;
}

</style>

</head>
<body>

<form method="POST" action="example.cgi">

<p><input type="text" name="item1" value="Example"></p>

<p><select name="item2">
<option value="select1">Select1</option>
<option value="select2">Select2</option>
<option value="select3" id="example">Select3</option>
<option value="select4">Select4</option>
<option value="select5">Select5</option>
</select></p>

<p><textarea name="item3" cols="50" rows="7">Example</textarea></p>

<p><input type="submit" value="Submit"></p>

</form>

</body>
</html>
Output

This form cannot submit because of a sample.