N
N
node_js2021-06-09 13:50:48
JavaScript
node_js, 2021-06-09 13:50:48

How to hide div if inside div is empty?

Can't figure out how to hide div.spoiler-wrap if div.spoiler-body is empty?

<div class="spoiler-wrap disabled">
  <div class="spoiler-head">Пример</div>
  <div class="spoiler-body">
   Это компания элона
  </div>
</div>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Markov, 2021-06-09
@node_js

There are 2 options .
1) If you receive information from the back, do not display the block if there is no information in it
2) If the state changes dynamically, then use js to hide

Y
Yupiter7575, 2021-06-09
@yupiter7575

spolier-wrap {
display;none;
height:0px;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question