Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

read-only grey text area 1

Status
Not open for further replies.

jianbo

Programmer
Dec 19, 2001
78
US
I want to create a text area which is grey and read-only,then user can't change it in a form. I know how to make it read-only, but how to make it grey? background?
jianbo
 
<input type=&quot;text&quot; value=&quot;Some Value&quot; disabled> DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
stylesheet:
input.readonly {background-color: #C0C0C0 }

form:
<INPUT type=&quot;text&quot; class=&quot;readonly&quot; READONLY value=&quot;you can't change this field&quot;>
hope this helps
 
Thanks, Deziner and y2k1981:
I tried both. Deziner's method change the font color to grey. While y2k1981's method has some problem. I change like this, then it works.
stylesheet:
input#anyid {background color:#C0C0C0}
form:
<input id=&quot;anyid&quot; .... READONLY>

Thank you again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top