admin管理员组文章数量:1332962
I know this will be marked as a duplicate but every suggested CSS fix out there is not working for me in IE 11.
I am trying to disable an input clear 'X' in IE 11.
Among numerous others I have tried:
input::-ms-clear {
display: none;
height: 0;
width: 0;
}
or, if anyone can tell me how to get that to work that would also be acceptable, but I would rather have it gone altogether.
I know this will be marked as a duplicate but every suggested CSS fix out there is not working for me in IE 11.
I am trying to disable an input clear 'X' in IE 11.
Among numerous others I have tried:
input::-ms-clear {
display: none;
height: 0;
width: 0;
}
or, if anyone can tell me how to get that to work that would also be acceptable, but I would rather have it gone altogether.
Share Improve this question asked Jan 27, 2017 at 18:12 captainKirk104captainKirk104 1871 gold badge3 silver badges7 bronze badges 6- And, what is an "input clear 'X'"? – Scott Marcus Commented Jan 27, 2017 at 18:17
- 1 That should work, Make sure you're running the page in standards mode. – Teemu Commented Jan 27, 2017 at 18:17
- 1 Seems to work fine: jsfiddle/o55qyjsp The ments on this answer suggest that there's no way to hide it in the Modern UI mode or in Compatibility Mode. Make sure your site isn't showing up in patibility mode. – JLRishe Commented Jan 27, 2017 at 18:18
- @ScottMarcus It's an icon that shows up when a text input has content in it. Clicking the X clears it. – JLRishe Commented Jan 27, 2017 at 18:19
- 1 @JLRishe I lied. I had patibility mode on. I didn't remove the tag ...meta(http-equiv= "X-UA-Compatible", content= "IE=9")... My confusion, thanks. – captainKirk104 Commented Jan 27, 2017 at 18:42
2 Answers
Reset to default 5(adding my ment from above as an answer since it turned out this was the cause of OP's issue)
Your CSS is fine:
input::-ms-clear {
display: none;
height: 0;
width: 0;
}
<input type="text" />
There is no way to hide the X if the browser is running in Modern UI ("Metro") mode or if the page is rendering in Compatibility Mode.
So triple check that there's nothing in your markup that would cause the browser to use patibility mode. If your users are using the Modern UI for some reason, there's not much you can do about that.
This works for me in IE 11 (IE 11 Document Mode)
::-ms-clear {
display:none;
}
It's slightly different than your selector which includes input
. I don't see why that should make a difference, but you should try the selector as I have it (without any tag prefix).
本文标签: javascriptDisable IE 11 input clear 39X39 buttonStack Overflow
版权声明:本文标题:javascript - Disable IE 11 input clear 'X' button - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742339110a2456234.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论