Internet Explorer 9及更低版本:
您可以使用条件注释为要专门定位的任何版本(或版本组合)加载IE特定的样式表,例如下面使用外部样式表的样式表。
<!--[if IE]> <link rel="stylesheet" type="text/css" href="all-ie-only.css" /><![endif]-->
但是,从版本10开始,IE中不再支持条件注释。
Internet Explorer 10和11: 使用-ms-high-contrast创建媒体查询,在其中放置IE
10和11特定的CSS样式。由于-ms-high-contrast是特定于Microsoft的(并且仅在IE 10+中可用),因此只能在Internet
Explorer 10及更高版本中进行解析。
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { }Microsoft Edge 12: 可以使用@supports规则
@supports (-ms-accelerator:true) { }内联规则IE8检测
我还有1个选项,但它只能检测IE8及以下版本。
margin-top: 10px9 *margin-top:10px; _margin-top:10px;
如您所指定的嵌入样式表。我认为您需要针对以下版本使用媒体查询和条件注释。



