CSS: IE11 未应用样式

CSS: IE11 not applying style

this page侧栏中有一个图形:

我在<head>:

<!--[if IE]>

    <link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/css/ie.css" media="screen" />

<![endif]-->

ie.css 文件包含 .textwidget {display: inline-block;} 但是 这个 CSS 规则没有被应用 当我 select <div class="textwidget"> 在 IE11 中检查图形

您错过了要添加的 link 个中的 type 个。应该是

<!--[if IE]>

    <link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/css/ie.css" media="screen" type="text/css" />

<![endif]-->

IE11 不支持 <!--[if IE]>.

等条件注释

来自MSDN

Important As of Internet Explorer 10, conditional comments are no longer supported by standards mode. Use feature detection to provide effective fallback strategies for website features that aren't supported by the browser.