How can I style an HTML INPUT tag so it maintains CSS when focused on Android 2.2+?

前端 未结 3 2105
故里飘歌
故里飘歌 2020-12-28 20:38

I was delighted to discover that Android 2.2 supports the position:fixed CSS selector. I\'ve built a simple proof-of concept, here:

http://kentbrewster.com/android-s

3条回答
  •  独厮守ぢ
    2020-12-28 21:22

    You might be able to solve it by using a bug in Android: http://code.google.com/p/android/issues/detail?id=14295.

    That is, don't display the input field right away. Instead, display an overlay div which listens on click and hides itself and shows the hidden input, and give the input focus. This somehow prevents Android from using the wierd input that gets placed on top of everything, and is instead using the browsers input field which you can style any way you want.

    As you'll note in the bug raport though, this doesn't work with input[type="number"]...

提交回复
热议问题