html - css expression :not with two condition -
this question has answer here:
i have weird situation cannot make work :not has 2 condition. want hide div in container except having specific class.
for example html
<div id="container"> <div class="show"></div> <div class="extra"></div> <div class="about"></div> <div class="sample1"></div> . . . <div class="sampleetc"></div> </div>
now css expression , not working
#container > div:not(.show), #container > div:not(.about){ display:none; }
any ideas why not working or css expression this, presume, :not not work 2 condition, or guessing first expression hide .about
i believe can chain :not
selector this:
div#container > div:not(.show):not(.about) { display: none; }
it appears work correctly on this fiddle.
Comments
Post a Comment