Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-27-2012, 05:22 PM   PM User | #1
AJLComputers
New to the CF scene

 
Join Date: Nov 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
AJLComputers is an unknown quantity at this point
Pseudo selector nth-of-type problem

Hi guys

New to the forum and would just like a little help with pseudo selectors and IE9. My HTML code is...

<div class="top-menu">
<ul>
<li><a href="#">Item one</a></li>
<li><a href="#">Item two</a></li>
<li><a href="#">Item three</a></li>
<li><a href="#">Item four</a></li>
<li><a href="#">Item five</a></li>
<li><a href="#">Item six</a></li>
</ul>
</div>

and my CSS is...

.top-menu li:nth-of-type(3n+1) { background-color: #91dad6; }
.top-menu li:nth-of-type(3n+2) { background-color: #003f40; }
.top-menu li:nth-of-type(3n+3) { background-color: #ff9b0c; }

This all works fine in Firefox, Chrome and Safari but in IE9, which does apparently support nth-of-type it doesn't work. It simply doesn't show the background color at all.

Any ideas what I need to do to get it to work?
AJLComputers is offline   Reply With Quote
Old 11-28-2012, 06:19 AM   PM User | #2
aaronhockey_09
Regular Coder

 
Join Date: Dec 2010
Posts: 411
Thanks: 21
Thanked 55 Times in 55 Posts
aaronhockey_09 is an unknown quantity at this point
You are most likely inside of "Compatibility mode" in IE
This makes IE act like the older versions of IE - change it back to IE9, and it should work fine.

Cheers
aaronhockey_09 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:01 PM.


Advertisement
Log in to turn off these ads.