CSS3 选择器无法在 IE 11 中隐藏密码显示图标

CSS3 selectors are not working to hide the password reveal icon in IE 11

我正在尝试使用 CCS 选择器隐藏密码显示图标,如下所示。

input::-ms-reveal{
display: none;                      
}

我的开发环境: .Net 框架:.Net 4.5.1, Visual Studio 2010 年, IIS 7.5

我使用 IE11,在 jsFiddle 中检查兼容性时,它可以正常工作并隐藏密码显示图标。

http://jsfiddle.net/evildonald/jLuF5/

为什么它在我的网站(本地和主机)中不起作用。任何想法作为解决方案表示赞赏..

谢谢!!

试试这个:

input::-ms-clear, input::-ms-reveal {
    display: none;
}

  • ::-ms-clear 表示文本边缘的按钮("clear button"),用于清除 <input> 元素的当前值
  • ::-ms-reveal 将一种或多种样式应用于 <input> type=password 控件的密码显示按钮

IE 10 仅支持使用 CSS

隐藏密码显示图标
input::-ms-clear, input::-ms-reveal {
 display: none;
 }

对于 IE 11,我使用 javascript 找到了解决方案 here 。希望这对其他人有帮助。