I have this layout... Basically, there is a space between the container and the top. I already found the solution, but I need to understand why this is happening.
body {
background-color: rgb(71, 59, 182);
margin: 0;
padding: 0;
}
.container{
display: block;
background-color: white;
text-align: left;
margin: 0;
width: 75%;
height: 100vh;
}
<body>
<div class="container">
<div>
<h1>Blablabla</h1>
</div>
<div class="forms">
<p class="forms-item">Name: <input type="text"> </p>
</div>
</div>
</body>
div>h1{
margin:0;
}
Would fix the problem. But I want to understand why this is happening. Why the container is not streching with the h1 margin.... Since it is inside of the container, it was supposed to stretch it.