Is it possible to set the display option to none for a css class only when it is used alone, without affecting it when used with another class?
Let's consider how the HTML code looks when I want to display the biography class:
<div class="user biography">
<p>Content</p>
</div>
But if I want the biography class to be hidden using display: none
when it is not accompanied by the user class:
<div class="biography">
<p>should hide</p>
</div>
The challenge arises because simply applying .biography { display: none; }
hides the biography class in both scenarios. How can this be achieved while ensuring it remains visible when combined with other classes?