开发者

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

开发者 https://www.devze.com 2023-01-25 14:48 出处:网络
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.

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.开发者_Go百科tab li:hover + (the next sibling that follows the current hovered one) {

}


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号