开发者

CSS: Using two adjacent selectors to select element after 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜