There is a webpage containing this fragment of HTML: <div class="a b"></div><div class="a"></div>. How can I hide the second div with CSS, leaving the first one visible? Please note, that I cannot add any other classes, as well as the visibility of the first div changes (sometimes relative, sometimes absolute) and it does not depend on me.
There is a webpage containing this fragment of HTML: <div class=a b></div><div class=a></div> .
Share
You can hide both then show the one that has both classes
aandbIf the mark-up won’t change you can hide the second div with the following:
This says anything with the class
athat directly follows anything with both classesaandbshould be hidden.