<div class="abc"></div>
I need to delete this div if there is nothing in between the div tags means when div is empty.
I am approaching in CSS like this
div.abc:empty{display:none;}
But I have one problem if I use this method. If there is a single space between div, like <div> </div>
:empty
doesn't work.
div.abc { border: 1px solid red; height:50px; }
div.abc:empty{display:none;}
<div class="abc"></div>
<hr/>
<div class="abc"> </div>