Good day! Faced such a problem. There is a block for the slider, it has content, but its height is still zero, if you do not set it fixed, but then you will not be able to make a normally adaptive one. Why it happens? and how can this problem be solved?

.slider { position: relative; .slide-prev { position: absolute; width: 25px; height: 43px; left: 5%; top: rem(140px); } .slide-next { position: absolute; width: 25px; height: 43px; right: 5%; top: rem(140px); } .slide { position: absolute; left: 10%; right: 10%; } } 
 <!--slider --> <aside class="slider clearfix"> <a href="#" class="prev"><img src="img/slider/slide-prev.png" class="slide-prev"></a> <a href="#" class="slide"><img src="img/slider/slider-1.png" class="slide__img"></a> <a href="#" class="next"><img src="img/slider/slide-next.png" class="slide-next"></a> </aside> 

  • Please explain what kind of block is it about? The .slider block has height in content, in this case 24px. - Mikl
  • @Mikl yes block slider. up to the page it has a height of = 0. and clearfix does not help .. - b-ars07
  • one
    If you execute your code, the height of .slider is 24px. Perhaps his parent block is compressed to zero, or there are more styles in the code that override its height and are not included here. - Mikl
  • @Mikl Parental block - content, it is the height of the whole page, there are all the rules. In the styles I don’t understand what can limit it, if I throw it in the sandbox, look? - b-ars07
  • one
    ok, let's see - Mikl

0