css - 兼容模式下的 Internet Explorer 10::-ms-clear

标签 css internet-explorer compatibility internet-explorer-10

我试图在 IE10 处于兼容模式时隐藏输入清除按钮。

我用过这个:

input[type=text]::-ms-clear, input[type=text]::-ms-reveal {
    display: none;
}

这适用于 IE10 标准模式但不适用于兼容模式。

有什么办法可以做到这一点吗?有什么方法可以使用 JavaScript 禁用它吗?

最佳答案

我知道这可能不是您正在寻找的答案,但微软表示这是“设计使然”并且是浏览器的“一项功能”,不会修复它。

http://connect.microsoft.com/IE/feedback/details/783743/disable-ie10-clear-field-button-when-rendering-in-compatibility-mode

The product team believes this item works according to its intended design.

有些人试过设置 line-height: 0;高度:0;填充:8px; padding-bottom: 8px; 根据以下帖子取得了一定程度的成功:

How to remove clear button ( 'X' button ) from IE10 textboxes in compatibility mode?

关于css - 兼容模式下的 Internet Explorer 10::-ms-clear,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21867735/

相关文章:

javascript - IE 的列表方法的替代方案?

android - apk 与此设备不兼容..和支持的设备 0

html - 文本对齐:居中;无法在 Safari 中工作

html - 文本在 div 中居中,另一个 div 在左边,右边框

css - 获取 Bootstrap 4 Vertical pills :after to line up with pills

c# - 如何在没有管理员权限的情况下安装 chrome-frame?

html - IE9 怪高 - 无法修复

internet-explorer-8 - 为什么我的网站以 IE8 兼容模式呈现?

c# - 是否有适用于 .Net 3.5 的 C#4.0 更改列表?

html - 嵌套的可滚​​动 Flexbox