CSS selector based on a condition

后端 未结 3 1335
走了就别回头了
走了就别回头了 2021-01-26 18:50

I am trying to get a CSS selector to check and apply the CSS based on the condition that if: sectionContent-noToolbar is available, then apply height:2em

3条回答
  •  不要未来只要你来
    2021-01-26 18:55

    No, it isn't.

    If they were siblings, then you could use the adjacent sibling combinator:

    .sectionContent-noToolbar + .sectionSeperator {
        height: 2em;
    }
    

    … but CSS has nothing that lets you modify an element based on its siblings descendants.

提交回复
热议问题