Selector for one tag directly followed by another tag

后端 未结 4 1148
死守一世寂寞
死守一世寂寞 2020-12-30 18:18

This selects all tags directly preceded by tags:

A+B {
    /* styling */
}

What is t

4条回答
  •  滥情空心
    2020-12-30 18:38

    You can ONLY do the converse: This selects all tags directly preceded by tags.

    This is logically equivalent to your request.

    I often use this to style a row of many checkboxes with labels

    CSS:

    label+input {
        margin-left: 4px;
    }
    

    DOM:

    
    
    
    

提交回复
热议问题