Input text color not set on browser override
I'm working on a site that needs to allow people to override the colors of the text through their browser settings. The way I've been doing this is to NOT set any color values for text in the CSS. In my testing I've noti开发者_运维知识库ced that inputs and selects which don't have any CSS color set for them stay black even if they are supposed to be overridden with a different color from the browser. I've attached some screenshots (all text should be blue) for Firefox as an example but have also seen this problem in IE.
Does anyone know if this is fixable and how to make input and select tags pick up the browser color?
Native form elements (especially in older browsers) are notoriously hard to style, both at the page CSS level, as well as at the browser level. Internet Explorer (at least versions 8 and older) use the native OS UI elements for form elements, and those get their default styles from the operating system itself.
The page can override the colors of the native form elements to a limited extent (and user-level CSS within the browser can as well).
If you are looking to have more control, you may want to consider using a JavaScript replacement for the native select box.
In answer to your question, however, the coloration on the form elements is likely a system-wide OS setting. (In Windows, this is controlled in the same place as where the color of the window chrome is controlled.)
精彩评论