When I disable input elements the text is taking the font color: #000000
in Firefox. This is not happening in IE. Please check the below page in IE and Firefox. Let me know how to give it a gray look as in IE.
test
Approach: With adding basic CSS property we are able to change the font-color of a disabled input. The disabled input element is unusable and un-clickable. This is a boolean attribute. Here using the color property of input we can change the font-color of this disabled input element.
In Chrome, it is the system color 'graytext', so you don't need to remember the hex code.
First step: swap the HTML elements order so that the <label> appears after the <input> . This will allow the styling rules to work as desired. Then for the fun bit: use CSS to position the labels for text inputs on the left hand side! input[type=radio]:disabled+label works like a sharm!
You can't disable anything with CSS, that's a functional-issue. CSS is meant for design-issues. You could give the impression of a textbox being disabled, by setting washed-out colors on it. Keep in mind that disabled inputs won't pass their values through when you post data back to the server.
Different browsers style disabled elements differently. Here is how you can control the style of disabled elements in Firefox.
[disabled] {
color:#ff0000;
background-color:#00ff00;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With