Question:
In Firefox, using a simple CSS class, it is possible to change the text colour in disabled textboxes. However, finding a solution for Internet Explorer 6 and 7 has proven to be elusive. Are there any elegant solutions to this challenge?
Answer:
The issue arises from the extent to which form fields are rendered based on the operating system's widget set and the degree to which they follow CSS rules. This variance has historically been a source of significant cross-browser differences.
Solution:
To circumvent this issue, consider using 'readonly' instead of 'disabled'. By applying styling, such as 'class="disabled"', you can recreate the desired shading effect associated with disabled controls. Since 'readonly' controls are not transformed into OS-level-disabled widgets, you have greater flexibility in styling them.
The above is the detailed content of Can You Style Disabled Textboxes in IE6 and IE7?. For more information, please follow other related articles on the PHP Chinese website!