Good day!
Faced the following problem: there is an html structure:
body { margin: 0; padding: 0; } #container{ min-height: 100%; padding-bottom: 50px; } .item1{ position: relative; width: 50%; height: 50px; margin: 0 auto; background-color: green; } .item2{ position: absolute; width: 50%; height: 1000px; background-color: blue; } #footer{ position: absolute; bottom: 0; width: 100%; height: 50px; background-color: black; } <body> <div id='container'> <div class='item1'> <div class='item2'></div> </div> </div> <div id='footer'><div> </body> Everything works fine, but it takes the .item2 element to take a great height, the screen is extended accordingly, and the footer turns out to be "floating" in the air 
Is it possible to somehow avoid this without removing the absolute positioning of the inner element?