无效的选择器webkit-credentials-auto-fill-button

时间:2017-05-02 09:10:19

标签: css safari

我试图设置下面Safari上密码字段中显示的关键图标的样式:

Screenshot of the credentials key on Safari

我正在尝试以下方法:



input::-webkit-credentials-auto-fill-button {
  color: white;
}

<input type="password" class="form-control form-control-lg" name="password" ngModel required placeholder="password">
&#13;
&#13;
&#13;

但那不起作用。知道为什么吗?

1 个答案:

答案 0 :(得分:1)

关于样式化这些元素的不直观之处在于您需要使用background-color

input::-webkit-credentials-auto-fill-button {
    background-color: white;
}

此处已有类似-webkit-contacts-auto-fill-button元素的答案:

Safari - Webkit contacts autofill button icon change color on empty