kipper
kipper

Reputation: 1

CSS child selector but have an a tag

Can't get the syntax for :nth(3) selector on this a tag, in the 3rd li tag. What a mouthful. Is it even possible?

On this website

www.cutlassandcane.com/shopping/

I am trying to change the color of the 3rd menu item. Bandoli to have red font. It is prestashop so I cannot add span tags around it, asit was cause issues elsewhere.

So, my question is, is there a way to do it through CSS using the 3 rd child, or nth, selector?

.sf-menu a, .sf-menu a:visited  { /* visited pseudo selector so IE6 applies text colour*/
    color:black;
    font-size:14px;
}

Upvotes: 0

Views: 136

Answers (2)

thirtydot
thirtydot

Reputation: 228162

You can use :nth-child(), like this:

.sf-menu > li:nth-child(3) > a {
    color: #c0474c;    
}

Note that :nth-child() is only supported in modern browsers. It doesn't work in IE8 or lower.

Upvotes: 2

Alexander Pavlov
Alexander Pavlov

Reputation: 32286

Do you mean to say .sf-menu > li:nth-child(3) > a?

Upvotes: 1

Related Questions