0

I would like to hide my outer div if price div is empty using just css. Can u help?

<div class="pricetag"> Hello
    <div class="price">400</div>
</div>

<div class="pricetag"> Hello2
    <div class="price"></div>
</div>

<div class="pricetag"> Hello3
    <div class="price">250</div>
</div>
Alex Chermenin
  • 838
  • 12
  • 24
  • On top of the duplication, you can't read the contents of an element with css. You'd need javascript. – Drew Kennedy Sep 27 '16 at 14:43
  • If the price div is empty, is it still present as an empty div, or is it not display? What you are asking may not be possible with just CSS. EDIT: nvm, this is evident from your sample code. I think you will need JS. – ESR Sep 27 '16 at 14:43
  • When the :has() pseudo-class becomes available you can do what you are trying to do using CSS – The One and Only ChemistryBlob Sep 27 '16 at 14:44

0 Answers0