Good day! I am interested in the possibility of centering a line element inside a block with an unknown height, which is inside a block with an unknown height. I mean, I reviewed a lot of resources and questions here, all lead to the fact that if the height of the parent unit is set, or at least the parent unit of the parent unit, then everything works. And this is true. And what if I have this CSS code:
#preloader { position:fixed; top:0; left:0; right:0; bottom:0; z-index: 9999; } .loader { position: absolute; } And this HTML:
<div id="preloader"> <div class="loader"> <span id="loader_txt">Здесь текст</span> </div> </div> I deliberately did not leave in the code allusions to lower-case elements, because it is obvious. I ask a little philosophical. If heights are unknown, it remains only to resort to JS? Thank.