Log in

View Full Version : nesting pseudo classes?



jql999@yahoo.com
03-22-2010, 03:01 PM
Hi All,

Is there a way to nest pseudo classes?

I'm trying to create a mega-breadcrumb like in the walmart site:

http://www.walmart.com/cp/For-the-Home/4044

I'm styling the "all departments" link differently using

li:first-child but now I want to add a hover to it to display the dropdown.

But li:first-child:hover doesn't work. (didn't think it would)

Thanks,
J

So is there a way to do this using only pseudo classes, or do I have to create a class or ID to replace :first-child?

Snookerman
03-22-2010, 09:20 PM
According to this article: http://css-tricks.com/pseudo-class-selectors/ (http://css-tricks.com/pseudo-class-selectors/) you can chain them. The example used is p:first-child:first-letter

What browser have you tested that in? Some browsers (i.e. IE) only support hovers on anchor tags.

jql999@yahoo.com
03-24-2010, 02:09 AM
According to this article: http://css-tricks.com/pseudo-class-selectors/ (http://css-tricks.com/pseudo-class-selectors/) you can chain them. The example used is p:first-child:first-letter

What browser have you tested that in? Some browsers (i.e. IE) only support hovers on anchor tags.
Thanks for the tip. I develop in Firefox and when it didn't work there I assumed I couldn't do it. Maybe if I swapped them li:hover:first-child.

And IE6 is the only browser that doesn't support hover on other tags besides <a>.