IE上的CSS条件 [英] Css Conditional on IE
本文介绍了IE上的CSS条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想说些类似的话
#mydiv { background-color: (IE ? red : blue) }
我相信可以通过条件注释来完成,但这将是丑陋的.还有其他更干净的技巧吗?
I believe this can be done with conditional comments but it will be ugly. Is there some other hack that is cleaner?
推荐答案
我怀疑您会比这少得多的丑陋":
I doubt you can get much less "ugly" than this:
所有浏览器的内部CSS文件:
#mydiv { background: blue }
包含该CSS文件后:
<!--[if IE]>
<style type="text/css">
#mydiv { background: red }
</style>
<![endif]-->
当然,您可以为IE加载一个全新的样式表.
Of course, you can load a whole new stylesheet for IE.
这篇关于IE上的CSS条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文