如何为 IE8 中焦点上的所有只读元素应用一些 css?
我想为焦点上的所有只读元素应用一些 css,但我不知道如何在 IE8 中执行此操作。对于 firefox、chrome、opera 它可以工作,但 IE8 不会看到这一点:
(background:#F8F8F8 !important; outline:none !important;)
非常奇怪,我不明白为什么即使在 IE8 中也应用了不透明度,并且背景、轮廓都没有应用。
*[readonly]{
opacity: 0.5;
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=55);
box-shadow:none !important;
-webkit-box-shadow:none !important;
background:#F8F8F8 !important;
outline:none !important;
}
如果有人可以帮忙,谢谢。
I want to apply some css for all readonly elements on focus and I don't know how to do that in IE8. For firefox,chrome,opera it works but IE8 wont to see this:
(background:#F8F8F8 !important; outline:none !important;)
Is very strange and I don't understand why the opacity is applied in even in IE8 and background, outline are not applied.
*[readonly]{
opacity: 0.5;
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=55);
box-shadow:none !important;
-webkit-box-shadow:none !important;
background:#F8F8F8 !important;
outline:none !important;
}
If someone can help, thank's.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您希望将其应用于焦点,也许您应该包含
:focus
伪类。如果这有效,下一步就是摆脱所有这些!important
,除非你真的非常需要它们:If you want it to be applied on focus, perhaps you should include the
:focus
pseudo-class. If that works the next step is to get rid of all those!important
s unless you really, really need them: