Select element based on child class

后端 未结 4 2056
北恋
北恋 2021-01-07 19:26

Is there a way in CSS to select an element which has a sub-element with given class?

I want to apply a style to a

    list that has
4条回答
  •  醉酒成梦
    2021-01-07 19:52

    No. The CSS Cascade does not allow for this kind of selector.

    The best solution in this case would be either to modify the DOM with JavaScript or to change up the resultant HTML to add classes to the ul tags.

提交回复
热议问题