接下来,我将给大家讲述下CSS4选择器的语法:
:not()选择器
描述::not()是个伪类选择器首次出现在CSS3中,当时它只允许一个简单选择器作为参数。但是在CSS4选择器中,它可以将选择器列表作为参数。样式应用于传递的参数没有表示的元素。
语法:
1 2 3 | E:not(s1, s2, ...) { /* Where s1 and s2 are two different selectors. */ } |
例子:
1 2 3 4 5 | /* In this example, all p elements will be red, except for the first child and the ones with the class special. */ p:not(:first-child, .special) { color: red; } |
浏览器支持:
Chrome | Friefox | Safari | Opera | IE | Edge | |
Desktop | no | no | yes | no | no | no |
Mobile | no | no | yes | no | no | no |
CSS更新到4了呀!!!真是孤陋寡聞了,很少關注這個呢
目前是W3C草案,不过很快就要定了,正在紧锣密鼓的进行探讨呢,详情请访问
https://www.sky8g.com/technology/2628/
欢迎你的下次光临,SKY8G网将更新IT技术最新知识供大家参考和研究。