CSS怎么表示非

html-css06

CSS怎么表示非,第1张

CSS没有表示非的。CSS只是样式表,不参与逻辑运算。CSS只有一个表示优先权的!important,作用是提高指定CSS样式规则的应用优先权!

也许你想要的是:

(设置非 <p>元素的所有元素的背景色:)

:not(p)

background-color: #ff0000

}

:not(selector) 选择器匹配非指定元素/选择器的每个元素。

<div style="float:leftwidth:100pxheight:25px"></div>

<div style="float:leftwidth:100pxheight:25px"></div>

<div style="float:leftwidth:100pxheight:25px"></div>

<div style="clear:both"></div>

<div style="float:leftwidth:100pxheight:25px"></div>

<div style="float:leftwidth:100pxheight:25px"></div>

<div style="float:leftwidth:100pxheight:25px"></div>

<div style="clear:both"></div>

<div style="float:leftwidth:100pxheight:25px"></div>

<div style="float:leftwidth:100pxheight:25px"></div>

<div style="float:leftwidth:100pxheight:25px"></div>