Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How can I let siblings' children respond to eachother?

How can I let siblings' children respond to eachother?

Problem

  • meh
  • aha!

This CSS would hopefully allow aha! to change when meh is focussed on

li a:focus ~ li a.target {

}

Of course it doesn't work because it is expecting an a:focus ~ li instead of a li a:focus

I have tried with li>a:focus ~ li a.target but it seems to make the same mistake, is there any way to group them so that they would produce the requested response? There doesn't seem to be a way to select a parent and crawl through the hierarchy...

Problem courtesy of: J V

Solution

There doesn't seem to be a way to select a parent and crawl through the hierarchy...

Unfortunately, there's no way to do that.

I'm not sure exactly what you want, but maybe this is it:

ul li:first-child:hover + li .target {
    color: red;
}

http://jsfiddle.net/thirtydot/XXZLM/

Solution courtesy of: thirtydot

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

How can I let siblings' children respond to eachother?

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×