Is there a selector to exclude display: none elements?

前端 未结 6 2167
醉话见心
醉话见心 2021-02-19 23:22

I want to select only whose parents have display: block and exclude those whose parents have display

6条回答
  •  暖寄归人
    2021-02-20 00:03

    No.

    There are no selectors which select elements based on the values of properties that apply to them.


    I don't think it would be practical for CSS to introduce such a feature either. Imagine:

    :has-property-value(display: none) {
       display: block;
    }
    

提交回复
热议问题