全浏览器兼容的自动填充样式方案

/* Chrome, Safari, Edge, Opera */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #151617 inset !important;
    -webkit-text-fill-color: #fff !important;
    border: 1px solid #d6d4d4 !important; 
    caret-color: #fff !important;
}

/* Firefox */
input:-moz-autofill,
input:-moz-autofill:hover,
input:-moz-autofill:focus,
input:-moz-autofill:active {
    background-color: #151617 !important;
    color: #fff !important;
    border: 1px solid #d6d4d4 !important; 
    caret-color: #fff !important;
}

/* 标准语法(未来兼容) */
input:autofill,
input:autofill:hover,
input:autofill:focus,
input:autofill:active {
    background-color: #151617 !important;
    color: #fff !important;
    border: 1px solid #d6d4d4 !important;
    caret-color: #fff !important;
}

TAG


— THE END —




0 条评论
  • 表情
  • 游客你好,回复内容需要 登录 查看!