1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
<!DOCTYPE html> <style> body { position: relative; height: 100vh; } .item1 { width: fit-content; margin: 0px auto; } .item2 { position: absolute; bottom: 0; background-color: cyan; height: 50px; width: 100%; } </style> <div class="item1">item1</div> <div class="item2">item2</div>