开发者

CSS: Using two adjacent selectors to select element after adjacent element

开发者 https://www.devze.com 2023-03-15 23:24 出处:网络
How can I do something like this? element + adjacent_element + element_to_style { /* somestyle */ } I want to style an element that\'s adjacent to the adjacent element.

How can I do something like this?

element + adjacent_element + element_to_style {
    /* somestyle */
}

I want to style an element that's adjacent to the adjacent element.

EDIT:

This code works properly, I just forgot the . before the classnames. That开发者_StackOverflow中文版's why it didn't work.


There is ~ general sibling selector. But is css3 so the browser support is limited.

0

精彩评论

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

关注公众号