Back

web - 修改chrome 浏览器自带的 表单自动完成的样式(替换默认的黄色背景)

发布时间: 2018-04-29 11:29:00

参考: https://css-tricks.com/snippets/css/change-autocomplete-styles-webkit-browsers/

把下面的css放到页面源代码的上方. 例如 <header>中.

/* Change Autocomplete styles in Chrome*/
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus
input:-webkit-autofill,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
  border: 1px solid #464861;
  transition: background-color 5000s ease-in-out 0s; 
  -webkit-box-shadow: 0 0 0 30px #13142E inset;
  -webkit-text-fill-color: white;
}

Back