2

我正在内部的客户网站上工作。特定的 CSS 不适用于 IE7,但适用于 IE8、9 等。

我正在使用 IE7 浏览和文档模式检查 IE9。

CSS:

ul.default-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  margin-bottom: 20px;
}

ul.default-list li {
  padding: 0;
  margin: 0;
  background: url(../images/arrow-red.gif) no-repeat left 6px;
  padding-left: 13px;
  margin-bottom: 17px;
}

.fl {
  float: left;
}

.no-margin li {
  margin: 0;
}

HTML:

<ul class="default-list fl no-margin" sizcache="2" sizset="10">
<li sizcache="0" sizset="20"><a href="#item1">Item 1</a></li> 
<li sizcache="0" sizset="21"><a href="#Item 2">Item 2</a></li>  
<li sizcache="0" sizset="22"><a href="#Item 3">Item 3</a></li>  
<li sizcache="0" sizset="23"><a href="#Item 4">Item 4</a></li>  
</ul>

IE8 模式截图

在此处输入图像描述

IE7模式截图

在此处输入图像描述

页面头部

<!DOCTYPE html>
<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="lt-ie9" lang="en"> <![endif]-->
<!--[if IE 9]>    <html class="ie9" lang="en"> <![endif]-->
<!--[if gt IE 9]><!--> <html lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700|Droid+Serif:400,400italic,700,700italic' rel='stylesheet' />
<link rel="stylesheet" href="js/fancybox/jquery.fancybox-1.3.4.css" media="all" />
<link rel="stylesheet" href="css/main.css?version=56" media="all"  />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-#####-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<link rel="stylesheet" href="css/about-us.css?version=56" media="all"  />
</head>

最后一个 CSS 文件是包含我上面提到的代码的 CSS

编辑:刚刚

我将我的头部部分剥离到这个,但问题仍然存在

 <!DOCTYPE html>
    <!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
    <!--[if IE 7]>    <html class="lt-ie9 lt-ie8" lang="en"> <![endif]-->
    <!--[if IE 8]>    <html class="lt-ie9" lang="en"> <![endif]-->
    <!--[if IE 9]>    <html class="ie9" lang="en"> <![endif]-->
    <!--[if gt IE 9]><!--> <html lang="en"> <!--<![endif]-->
    <head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="css/about-us.css?version=56" media="all"  />
    </head>
4

1 回答 1

3

我已经评估了你的 css,你的 css 有问题,如果我删除上面的整个 cssul.default-list就可以了。

编辑:

正如我所假设的那样,您的 CSS 行有问题,1038

ol li:before, ol .num { float: left; margin: 0 4px 0 0; padding: 0 7px 0 0; background: url(../images/bullet.gif) no-repeat 100% 8px; color: #000; content: counters(item, ".") " "; counter-increment: item; }

和线1046

ol li:before, ol .num { float: left; margin: 0 4px 0 0; padding: 0 7px 0 0; background: url(../images/bullet.gif) no-repeat 100% 8px; color: #000; content: counters(item, ".") " "; counter-increment: item; }

我认为在这些行中我content: counters(item, ".") " ";应该content: counters(item,".") " "删除了它们之间的空间(item,".")并且它有效。

于 2012-07-31T08:15:15.847 回答