By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,648 Members | 1,190 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,648 IT Pros & Developers. It's quick & easy.

Setting the text color of a disabled text box

P: n/a
Simply put - if I have a disabled textbox how could I change the font-color
from gray?

e.g. <input type="text" disabled></input>

Color no longer seems to work. Can it be done and if so how?

Thanks,
Chris Ullman
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
In article <c0**********@hercules.btinternet.com>,
chris.ullman@REMOVE_THISbtinternet.com enlightened us with...
Simply put - if I have a disabled textbox how could I change the font-color
from gray?

e.g. <input type="text" disabled></input>

Color no longer seems to work. Can it be done and if so how?

Thanks,
Chris Ullman


Only in Mozilla/Netscape:
input[disabled] {color:red!important;}

As in:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title> New Document </title>
<style type="text/css">
input {
color: green;
}
input[disabled] {color:red!important;}
</style>

</head>

<body>
<form>
<input type="text" disabled value="disabled"></input><br>
<input type="text" value="normal"></input>
</form>
</body>
</html>
I didn't find a way for IE or Opera.

--
--
~kaeli~
Every calendar's days are numbered.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.