Jitendra Vyas
Jitendra Vyas

Reputation: 152935

CSS not working in IE7 but all

I'm working on a client site in-house. Where a particular CSS is not applying in IE7 but fine in IE8,9 and others.

I'm checking in IE9 with IE7 browsing and Document mode.

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>

Screenshot with IE8 Mode

enter image description here

Screenshot with IE7 mode

enter image description here

Head section of the page

<!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>

The last CSS file is the CSS which has the code I mentioned above

Edit: Just now

I stripped my head section to this, but issue is still there

 <!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>

Upvotes: 2

Views: 3900

Answers (1)

Ahsan Khurshid
Ahsan Khurshid

Reputation: 9469

I have evaluated your css, there is something wrong in your css, If I remove the whole css above from ul.default-list it works fine.

EDITED:

As I assumed, there is something wrong in your CSS at line 1038 i.e

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; }

and line 1046 i.e.

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; }

I think in these lines content: counters(item, ".") " "; should be content: counters(item,".") " " I have removed the space between (item,".") and it works.

Upvotes: 3

Related Questions