首页 > css替换chrome浏览器默认input:-webkit-autofill 样式失败

css替换chrome浏览器默认input:-webkit-autofill 样式失败

自己重写的css样式已经被chrome识别 但是还是无法改变 默认黄色的背景
肿么办?


直接覆写是没有用的……StackOverflow上面有一个hack还算好使:

    input:-webkit-autofill,
    textarea:-webkit-autofill,
    select:-webkit-autofill {
        -webkit-box-shadow: 0 0 0 1000px white inset;
    }

当然box-shadow是很慢的,所以你可以尽可能的缩小1000px。

同时,另外一个问题是,为何不直接禁用autocomplete属性呢?

<input type="text" name="form_email" id="form_email" value="" placeholder="邮箱/手机号" tabindex="1" autocomplete="off">

应该是input:-webkit-autofill吧,后面的.txt是干什么用的?

【热门文章】
【热门文章】