Is there any way to get the CSS :not() selector working in IE and Chrome?

后端 未结 1 906
名媛妹妹
名媛妹妹 2020-12-19 15:50

Anyone know any tricks to use the CSS :not() selector in IE and Chrome?

e.g. this works in Firefox: iframe:not(.anifrmclass){}

相关标签:
1条回答
  • 2020-12-19 16:12

    Specificity is your friend. Apply your :not(.anifrmclass) styles to all <iframe>s then override with other values for <iframe class="anifrmclass">.

    iframe {
        /* Styles for all -other- iframes */
        display: none;
    }
    
    iframe.anifrmclass {
        /* Override for this class with values other than the above */
        display: inline-block;
    }
    
    0 讨论(0)
提交回复
热议问题