skip to Main Content

Html – 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;…

VIEW QUESTION

Html – Why padding does not center in div?

Easy question for you guys from the beginner: why are there different sizes of top and bottom padding and they are not in the center of div? <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Website</title> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v6.0.0/css/all.css"> <link rel="stylesheet"…

VIEW QUESTION
Back To Top
Search