CSS 在 Windows 8 上删除 IE11 的“清除字段”X 按钮

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20473413/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 01:14:27  来源:igfitidea点击:

Remove IE11's "clear field" X button on Windows 8

cssinternet-explorerwindows-8

提问by Phil O

Following the advice given in Remove IE10's "clear field" X button on certain inputs?

遵循在某些输入上删除 IE10 的“清除字段”X 按钮中给出的建议

.someinput::-ms-clear {
    display: none;
}  

worked great with IE 11 on Windows 7 but not with IE 11 on Windows 8.1

在 Windows 7 上与 IE 11 配合使用时效果很好,但在 Windows 8.1 上与 IE 11 配合使用时效果不佳

I also tried

我也试过

.someinput::-ms-clear {
    height: 0;
    width: 0;
} 

Any thoughts on removing the X on IE 11/Windows 8.1? Thanks

关于在 IE 11/Windows 8.1 上删除 X 的任何想法?谢谢

回答by DD.

I had the same issue and the most of the css didn't help me to remove the clear button. I solutioned this by simply setting width and height to 0 (plus display none)

我遇到了同样的问题,大部分 css 都没有帮助我删除清除按钮。我通过简单地将宽度和高度设置为 0(加上不显示)来解决这个问题

.someInputdisplay::-ms-clear {display: none; width:0; height:0;}

I hope this might be helpful!

我希望这可能会有所帮助!

回答by davyu

Check if "Display intranet sites in Compatibility View" was checked by default in Tools->Compatibility View Settings. Targetting ::-ms-clear and ::-ms-reveal doesn't work in compatibility mode.

检查是否在工具->兼容性视图设置中默认选中了“在兼容性视图中显示内网站点”。定位 ::-ms-clear 和 ::-ms-reveal 在兼容模式下不起作用。

回答by David Randall

Can you use ::-ms-reveal for Win8 in conjunction with ::-ms-clear? http://msdn.microsoft.com/en-us/library/windows/apps/hh465773.aspx

您可以将 ::-ms-reveal for Win8 与 ::-ms-clear 结合使用吗?http://msdn.microsoft.com/en-us/library/windows/apps/hh465773.aspx

.someinput::-ms-clear,
.someinput::-ms-reveal {
  display: none;
}