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

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -