My child elements overflow the parent and I'm unable to understand why it's happening and how to resolve it?
<div class="parent">
<div class="child">Child one</div>
<div class="child">Child two</div>
</div>
.parent{
max-width:200px;
background:lightblue;
margin: 3rem auto;
padding:1rem;
border-radius:1rem
}
.child{
margin:1rem;
background:lightgray;
padding:1rem;
border-radius:1rem;
width:100%;
}
Here is a screenshot of the result:
Here is what it should look like: