繁体   English   中英

IE的条件评论不起作用

[英]Conditional comments for IE not working

我正在尝试使用条件注释包含仅限IE7的样式表:

<head>
  <meta charset="utf-8">
  <title>Title</title>
  <meta name="description" content="Description">
  <link href="/static/styles/bootstrap.min.css" rel="stylesheet">
  <link href="/static/styles/font-awesome.min.css" rel="stylesheet">
  <link href="/static/styles/main.css" rel="stylesheet">
  <link href='//fonts.googleapis.com/css?family=Quicksand:700' rel='stylesheet' type='text/css'>
  <!--[if lt IE 9]>
    <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
  <![endif]-->
  <!-- [if IE 7]>
    <link type="text/css" rel="stylesheet" href="/static/styles/ie7.css">
  <![endif]-->
  <link rel="icon" type="image/png" href="/static/images/layout/favicon.png">
  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>

我有一个Windows 7虚拟机(在VirtualBox上运行),我正在使用IE9中的开发人员工具将浏览器模式切换到IE7。 引用的样式表中没有任何内容应用于页面。 我正在加载这个样式表,我正在使用!important对所有内容都很!important ,我已经对文件名和路径进行了三重检查,但样式仍未应用。 谁能看到我出错的地方?

有一个空间

<!--RIGHT HERE[... remove that one

之前:

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

后:

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

不确定是不是这样

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM