Ryan
Ryan

Reputation: 22227

CSS: Possible to select a certain child plus the immediate following sibling?

I'm currently doing this using Javascript, however, I was wondering if it's possible to select a certain child of an unordered-list and then its immediate sibling, using CSS.

Example with 4 list-items:

ul.tab li:hover + (the next sibling that follows the current hovered one) {

}

Upvotes: 3

Views: 985

Answers (1)

annakata
annakata

Reputation: 75794

You want the adjacent sibling selector for which you amusingly basically have the syntax already.

Be advised: :hover is specifically a x-browser problem in Safari though.

Upvotes: 4

Related Questions