.sample{
height:15px;
width:15px;
margin:10px;
padding:10px;
float:left:
/* this one apply in ie only */
border:1px solid #fff;
/* this one apply in ie only */
}
最佳答案
我建议使用完全独立的 IE 特定样式表,以隔离您使用的所有讨厌的 IE hack。然后,在您的 HTML 中,您可以使用条件注释来加载仅适用于 IE 的样式表。
HTML
<html>
<head>
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="/css/ie-hacks.css">
<![endif]-->
</head>
<body>
<!-- ... --->
</body>
</html>
ie-hacks.css
.sample{
border:1px solid #fff;
}
关于css - 我如何在 Internet Explorer 中应用一个 css 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4165962/