CSS multiple class selection -
there webpage containing fragment of html: <div class="a b"></div><div class="a"></div>
. how can hide second div css, leaving first 1 visible? please note, cannot add other classes, visibility of first div changes (sometimes relative, absolute) , not depend on me.
you can hide both show 1 has both classes a
, b
.a {display: none;} .a.b {display: block;}
if mark-up won't change can hide second div following:
.a.b + .a {display:none;}
this says class a
directly follows both classes a
, b
should hidden.
Comments
Post a Comment