Reputation: 13623
I have simple JQuery Mobile form where I have textfields that could be disabled or enabled depending on some conditions. Normal enabled textfield looks like this:
and disabled looks like that:
I'd like to make the text in the disabled field a bit more readable. How can I do this?
HTML
<asp:Label ID="lblCityPostal" AssociatedControlID="txtCityPostal" runat="server"
Text="City"></asp:Label>
<div class="clear">
</div>
<asp:TextBox ID="txtCityPostal" runat="server">
Solution
As suggested below I'm now using the following CSS:
input.regTxt:disabled {
font-weight:bold;
}
I've added CssClass="regTxt"
to all my text fields.
Upvotes: 4
Views: 826
Reputation: 941
Use the :disabled
selector
input:disabled {
color: your_color;
}
Upvotes: 1
Reputation: 30531
Use :disabled
selector. For example:
input:disabled {
color: #444;
border: 1px solid #888;
}
See this Fiddle for a demo: http://jsfiddle.net/A9CN8/
All notable modern browser support :disabled, but for Internet Explorer 8 and below you are out of luck: for those browsers you cannot change the look of disabled controls.
Upvotes: 3
Reputation: 157414
You can use :disabled
input[type="text"]:disabled {
/* This may lack browser support so go for the next selector*/
border: 1px solid #f00;
}
Or you can also use element[attr=val]
selector
input[type="text"][disabled="disabled"] {
border: 1px solid #f00;
}
Upvotes: 4