djmordigal
djmordigal

Reputation: 559

Can't get certain CSS code to work in Drupal 7 site on IE 8

I am working on a Drupal 7 site, and it's kind of important to make sure it works in IE 8. It looks pretty good so far, except the table on one of the pages is not styling odd and even child rows.

I used the CSS3 tr:nth-child(odd) and tr:nth-child(even) to alternate table row background colors. I'm suspecting the reason it's not working in IE8 is because it's CSS3 and it's conflicting.

I did download the HTML5shiv library, and put it in the same directory as my theme's .info file. I also added the following line to the file:

scripts[] = dist/html5shiv.js

And yes, I double checked the directory listings for each file, and everything seems to be correct.

But none of that seems to be helping, the table is just showing up as having a white background for all the data rows.

Is there anything else I can try to get it working?

EDIT: Yes, I have also enabled JS in IE 8. It's still not working.

Upvotes: 0

Views: 57

Answers (2)

pi_ron
pi_ron

Reputation: 210

The HTML5shiv library is used to add support of HTML5 elements such as or to Internet Explorer, allowing them to be understood (read) by the browser, and rendered.

It does not add any CSS3 support as far as I know, besides being able to select elements like so:

navigation li a:hover { background:hotpink; }

or

article p:first-child { font-size:1.5em; }

Checkout the workaround here which may help you:

IE8 :nth-child and :before

Upvotes: 0

Bobadevv
Bobadevv

Reputation: 366

The selectors you are using are not compatible with ie8, you will need to use a javascript library to allow you to use them. Give http://selectivizr.com a go this will add CSS3 selector compatibility for ie8.

Upvotes: 1

Related Questions