css3 - Adding a :NOT selector to a CSS request -
this question has answer here:
i have class:
li:before { margin: 0 5px 0 -15px; color: #005984; content: "■"; }
but don't want apply if contained elements class="k-list"
<abc class="k-list"> not applied here </abc>
how add :not above css?
the best way override whatever added element if contained element class .k-list
:
li:before { margin: 0 5px 0 -15px; color: #005984; content: "■"; } .k-list li:before { display: none; }
if, reason, want make sure @ least 1 of higher elements in dom not have class k-list
(including html , body):
*:not(.k-list) li:before { margin: 0 5px 0 -15px; color: #005984; content: "■"; }
if knew wanted start such search, however, more specific , useful:
body *:not(.k-list) li:before { margin: 0 5px 0 -15px; color: #005984; content: "■"; }
the above css exclude elements not contained body element meeting *:not(.k-list)
condition.
Comments
Post a Comment