My problem: I'm designing a page with a darkish theme and I want my text inputs to follow the theme with dark background, light text. I simply set my text input like this:
#name_of_my_text_input {
background-color: black;
color: white;
}
thi开发者_如何学编程s gets the desired result in desktop browsers and on iPhone but when I click the input on an Anddroid device (tried it on a HTC Sensation and some older Samsung) it defaults to white background with black text, looking totally horrible. Any way to stop Android from overriding my design or is this something I'll have to live with?
To specify: this is the relevant part of my layout. Just plain simple html:
<input id="name_of_my_text_input" type="text" name="n" />
Have you trieds using a reset.css? http://meyerweb.com/eric/tools/css/reset/
The goal of a reset stylesheet is to reduce browser inconsistencies in things like default line heights, margins and font sizes of headings, and so on.
Try to add -webkit-text-fill-color: #fff !important;
to your css, that is:
#name_of_my_text_input {
background-color: black;
color: white;
-webkit-text-fill-color: #fff !important;
}
精彩评论