css3 - Determining if an attribute is absent via CSS Attribute Selector? -


can css attribute selector, and/or combination of selectors, used determine if attribute absent?

an attribute selector can used test if attribute blank:

[aria-label=''] 

... attribute still must present in order pass. if html tag not have attribute @ all, above selector not pass.

can selector written in way pass if attribute not there?

something this?

div:not([aria-label]) {    color: red;    }
<div aria-label="test">    test  </div>    <div>    test2  </div>


Comments