strong text
i dont understand why my header go down when i give to his child (.navigation) margin-top? if i give padding its okay my header stays on the top but why not by giving margin
i did research that ovorflow: auto fix the problem (yes it is) but why? can someone explain please
/* RESET */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* VARIABLES */
:root {
--pimery_color: #fff;
--accent: #FBD784;
}
/* BODY */
body {
font-family: 'Gilroy';
font-weight: 700;
font-style: normal;
font-size: 18px;
color: var(--pimery_color);
background-color: #0B1D26;
}
/* HEADER */
.header {
background-color: red;
}
.navigation {
display: flex;
justify-content: space-between;
align-items: center;
margin-top:100px;
}
<header class="header">
<div class="navigation">
<p class="logo">MNTN</p>
<nav class="nav">
<ul>
<a href="#">Equipment</a>
</ul>
<ul>
<a href="#">About us</a>
</ul>
<ul>
<a href="#">Blog</a>
</ul>
</nav>
<div class="account">
<img src="./img/svg/acc.png" alt="account logo for login" />
<a href="#">Account</a>
</div>
</div>
</header>