CSS select multiple descendants of another element

后端 未结 2 873
萌比男神i
萌比男神i 2020-12-03 13:54

Is it possible to select multiple elements that have an ancestor of a certain class, id, etc in CSS? e.g:

table.exams caption, tbody, tfoot, thead, tr, th, t         


        
2条回答
  •  北荒
    北荒 (楼主)
    2020-12-03 14:17

    Is it possible to select multiple tags that have an ancestor of a certain class in CSS?

    It is possible to use SCSS to achieve a result similar to :matches, as shown in this article

    Also, certain browsers have partial support for :matches with vendor specific prefix.

提交回复
热议问题