Closed. This question needs details or clarity。它当前不接受答案。
                            
                        
                    
                
                            
                                
                
                        
                            
                        
                    
                        
                            想改善这个问题吗?添加详细信息并通过editing this post阐明问题。
                        
                        3年前关闭。
                                                                                            
                
        
是否可以对条件注释执行以下操作:

<!--[if IE]>
   .ie-only{margin-top:-13px;}
<![endif]-->

最佳答案

你可以这样...



<html>

<head>
  <!--[if IE]>
  <style>
    .box {
        width: 500px;
        background:red;
        padding: 100px 0;
      }
  </style>
<![endif]-->
</head>

<body>
  <div class="box">Try this in IE</div>
</body>

</html>





编辑:

您还可以仅包含IE的外部CSS。

<!--[if IE]>
    <link rel="stylesheet" type="text/css" href="onlyfoie.css" />
<![endif]-->

关于css - 条件语句在其中添加CSS ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/38833905/

10-12 14:34
查看更多