Padding top creates extra gap between element of absolute child
<!DOCTYPE html> <html> <title>Online HTML Editor</title> <head> <style> .section{ position:relative; min-height: 20vh; display: flex; align-items: center; justify-content: center; padding: 25px 15px 15px; background: red; } .section:nth-child(even){ background: transparent; } .floater{ position: absolute; background: #31ff0057; height: 100%; width: 100%; z-index: -1; } </style> </head> <body> <div class=”section”>First Section. Lorem ipsum dolor sit, amet consectetur adipisicing elit.… Read More Padding top creates extra gap between element of absolute child