Can I write a CSS selector selecting elements NOT having a certain class or attribute?

前端 未结 10 613
不知归路
不知归路 2020-11-22 10:47

I would like to write a CSS selector rule that selects all elements that don\'t have a certain class. For example, given the following HTML:



        
10条回答
  •  一整个雨季
    2020-11-22 11:29

    You can use :not(.class) selector as mentioned before.

    If you care about Internet explorer compatibility I recommend you to use http://selectivizr.com/.

    But remember to run it under apache otherwise you won't see the effect.

提交回复
热议问题