I want to hide div
when it is empty, through CSS, preferably, but I already applied a style that I don't want to sacrifice.
Here is my code rendered as:
<div class="auto-style2"></div>
Here is my second style:
.auto-style2 {
width: 1100px;
height: 200px;
overflow-y: scroll;
border:1px solid #d3d3d3;
}
I tried: empty-cells: hide;
, but that didn't work.
The link below recommended, div:empty { display: none }
;
But since my div is already using a different style, I would think that it would have to be done through that style only; I think it is going to ignore div:empty
; because the second is applied to my div.
Related: How to hide/remove a DIV when empty
.auto-style2:empty { display: none; }