SilverHorn
SilverHorn

Reputation: 1026

Disabled textarea without color change

How do I make a textarea that is disabled, but the background and text colors don't change? Is it possible?

Upvotes: 2

Views: 6718

Answers (1)

digi
digi

Reputation: 2769

If you're using a styled textarea you could easily add a class to it that has the same styling as the other (not disabled) elements.

Take a look at this:

<style>
input[type=button] {
    background: #FFF;
    border:1px solid #000;
    color: #000;
    padding: 10px;
}
</style>

<input type="button" disabled="disabled" value="I'm disabled :(" />
<input type="button"  value="I'm not :)" />

That's an example of how you can change the appearance of disabled elements (buttons in this case, but textareas should work the same).

It looks something like this:

Preview

Upvotes: 3

Related Questions