Html Internet Explorer 10 Windows 8 删除文本输入和密码操作图标
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10842665/
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
Internet Explorer 10 Windows 8 Remove Text Input and Password Action Icons
提问by Oliver Spryn
I am testing a highly-customized web application in Internet Explorer 10 on Windows 8, since it is an up and coming release, and will likely be using my application some day. Take a look at this sample screenshot of some text input controls from the application:
我正在 Windows 8 上的 Internet Explorer 10 中测试高度定制的 Web 应用程序,因为它是一个即将发布的版本,并且可能有一天会使用我的应用程序。看一下应用程序中一些文本输入控件的示例屏幕截图:
Is there a way, either within HTML or CSS, to remove the action icons that are located to the right of the text and password input controls?
有没有办法在 HTML 或 CSS 中删除位于文本和密码输入控件右侧的操作图标?
Thank you for your time.
感谢您的时间。
回答by i_am_jorf
You need to use the -ms-clear pseudo-element. And use -ms-revealfor the password box.
您需要使用-ms-clear 伪元素。并使用-ms-reveal作为密码框。
This should do it:
这应该这样做:
::-ms-clear {
display: none;
}
回答by Emre
回答by MattCT
jeffamaphone's answer works unless the browser is in compatability mode:
除非浏览器处于兼容模式,否则 jeffamaphone 的回答有效:
You need to use the -ms-clear psuedo-element. And use -ms-reveal for the password box.
This should do it:
::-ms-clear { display: none;
}
您需要使用 -ms-clear 伪元素。并使用 -ms-reveal 作为密码框。
这应该这样做:
::-ms-clear { display: none;
}
But, when the browser is in compatability mode, the reveal icon still appears. To get around this, force the browser into IE10 mode with this tag <meta http-equiv="x-ua-compatible" content="IE=edge">
但是,当浏览器处于兼容模式时,显示图标仍会出现。要解决此问题,请使用此标签强制浏览器进入 IE10 模式 <meta http-equiv="x-ua-compatible" content="IE=edge">
回答by Pushker Yadav
Remove action icons from text fields in Internet Explorer 10 just use this css pseudo element
从 Internet Explorer 10 中的文本字段中删除操作图标只需使用此 css 伪元素
::-ms-clear {
display: none; }
Remove action icons from password fields in Internet Explorer 10 just use this css pseudo element
从 Internet Explorer 10 中的密码字段中删除操作图标只需使用此 css 伪元素
::-ms-reveal
{
display: none;
}
回答by JudeJitsu
I don't have Windows 8 preview but have you tried just creating a custom input field using HTML and CSS? Maybe try this : http://www.webdesign4me.nl/Knowledge-Base/custom-input-field-using-html-and-css
我没有 Windows 8 预览版,但您是否尝试过使用 HTML 和 CSS 创建自定义输入字段?也许试试这个:http: //www.webdesign4me.nl/Knowledge-Base/custom-input-field-using-html-and-css
回答by Oursopodiac
The solution for IE10-docmode "standard" has been posted before.
I incidentially found some kind of workaround which is independent from IE10-docmode.
If you can live with changing the width of all inputs to a maximum of 80 pixels use the following jquery:$("input[type=text]").width(80);
IE10-docmode“标准”的解决方案之前已经发布过。
我偶然发现了某种独立于 IE10-docmode 的解决方法。如果您可以将所有输入的宽度更改为最大 80 像素,请使用以下 jquery:$("input[type=text]").width(80);
回答by Mechow
Perhaps not the best solution, but if any of the other solutions on this page aren't working for you, try this.
也许不是最好的解决方案,但如果此页面上的任何其他解决方案不适合您,请尝试此操作。
Place a blank background image on the :before of the input. More specifically - I had my own clear button styled like the website, and IE underlayed its own. I changed the original transparent PNG with my clear icon, with a solid background one.
在输入的 :before 上放置一个空白背景图像。更具体地说-我有自己的清晰按钮,其样式类似于网站,而 IE 则是它自己的底层。我用我的清晰图标更改了原始透明 PNG,并带有纯色背景。
Other browsers don't see a difference, and it blocks the IE clear button. Only works when the input background color doesn't change I suppose.
其他浏览器看不出区别,它会阻止 IE 清除按钮。我想只有当输入背景颜色没有改变时才有效。