#outer {
width: 200px;
height: 200px;
background-color: white;
border-radius: 20px;
}
#inner {
width: 200px;
height: 50px;
background-color: steelblue;
border-radius: 20px 20px 0 0;
}
body {
background-color: steelblue;
}
<div id="outer">
<div id="inner"></div>
</div>
You can see that the white background of the parent is leaking behind the child, even though they have the same border-radius. How can I prevent this?
Edit: Neither of the duplicate questions appropriately answer my question. The leak still happens in the first question. The second question's marked answer uses an image and Javascript, which should not be necessary to fix this.