พีวดโอคลาส not
พีวดโอคลาส not กำหนดการปฏิเสธ
ตัวอย่างเช่น p:not(.last) หมายถึง เลือก
ย่อหน้าทั้งหมดที่ไม่มีคลาส last
not ที่ซ้อนกันไม่ทำงาน
ไวยากรณ์
selector:not(negation) {
}
ตัวอย่าง
ทำให้ li ทั้งหมดเป็นสีแดง ยกเว้นตัวแรก:
<ul>
<li>list item</li>
<li>list item</li>
<li>list item</li>
<li>list item</li>
<li>list item</li>
</ul>
li:not(:first-child) {
color: red;
}
: