samedi 2 octobre 2021

Why similar CSS snippets are showing different values? [duplicate]

Even though the margin padding is 0, still, why there is white space in between? What's wrong with my CSS code. The header section perfectly fith with the main section with no white space in between. But inbetween the main section and footer thats not the case.

enter image description here

.header{height: 80px; background-color: aquamarine;}

.div1 {height: 535px; background-color:burlywood; display:inline-block; width: 50%; }
.div2 {height: 535px; background-color:rgb(94, 130, 185);display:inline-block; width: 50%; }

.foot{background:darkgrey; text-align:center; height:150px }

*{margin: 0;
    padding: 0;}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="practice.css">
</head>
<body>

<div class="header"></div>


<div class="div1"></div><div class="div2"></div>


<div class="foot"></div>

</body>
</html>



Aucun commentaire:

Enregistrer un commentaire