Why do my child elements ignore the parent class flex styling?
.container {
width: 100%;
max-width: 1800px;
margin-left: auto;
margin-right: auto;
}
.parent {
display: flex;
width: 100%;
background-color: white;
}
.child {
width: 50%;
border-style: double;
}
<div class="parent">
<div class="container">
<div class="child">
<p>Hello</p>
</div>
<div class="child">
<p>Hello</p>
</div>
</div>
</div>
If the container element does not wrap the two child elements then the child elements align aside each other as expected