I think this is indeed due to Margin Collapse as mentioned by KIKO Software. Because there is no content in the container
If you add for example some text in the container div, the margins seem to be equal all sides.
If you want to leave the container empty, you can set display: inline-block on the container element and you will end up with equal margins.
Info from MDN:
No content separating parent and descendants
If there is no border, padding, inline part, block formatting context created, or clearance to separate the margin-top of a block from the margin-top of one or more of its descendant blocks; or no border, padding, inline content, height, or min-height to separate the margin-bottom of a block from the margin-bottom of one or more of its descendant blocks, then those margins collapse. The collapsed margin ends up outside the parent.
body {
margin: 0;
width: 100%;
height: 2000px;
}
.container {
width: 100%;
height: 2000px;
background-color: rgb(34, 34, 241);
background-color: rgb(47, 224, 255);
display: inline-block;
}
.child1 {
width: 45%;
height: 15%;
background-color: crimson;
margin: 20px;
}
<body>
<div class="container">
<div class="child1"></div>
</div>
</body>