如果浏览器是 IE,则应用 CSS 规则 [英] Apply CSS rules if browser is IE
本文介绍了如果浏览器是 IE,则应用 CSS 规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能的重复:
如何在 CSS 中处理 IE 条件?
如何将以下规则仅应用于 IE?
How can I apply the rules below to IE only?
.abc {
float:left;
height:0;
margin:0 10px;
width:0;
/*Apply these rules for IE only*/
position:absolute;
left:30;
top:-10;
/*Apply these rules for IE only*/
}
推荐答案
在包括 IE9 在内的浏览器中,这是通过 条件评论.
In browsers up to and including IE9, this is done through conditional comments.
<!--[if IE]>
<style type="text/css">
IE specific CSS rules go here
</style>
<![endif]-->
这篇关于如果浏览器是 IE,则应用 CSS 规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文