input:-webkit-autofill

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_36671474/article/details/77980502

chrome表单input获取焦点时,input会有一个记录之前填写过的文本的下拉列表式的东东,当你选择其中一个时,input文本框的背景会变成黄色的(如下图),这是由于chrome会默认给input加上input:-webkit-autofill私有属性,然后对其赋予以下样式:


input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill {
  1. background-colorrgb(250, 255, 189);
  2. background-imagenone;
  3. colorrgb(0, 0, 0);

猜你喜欢

转载自blog.csdn.net/qq_36671474/article/details/77980502