I simply have a div inside another div with overflow: hidden and if you are in chrome then you will see whitespace around the border especially when zooming in and out, if you are in firefox it is less glitchy and there is only white space in the corners of the border. chrome screenshot / firefox screenshot
<style>
.div1 {
border: 10px solid purple;
border-radius: 30px;
height:300px;
width:300px;
overflow: hidden;
position: relative;
}
.div2 {
background: purple;
position: absolute;
height: 400px;
width: 400px;
top: -20px;
left: -20px;
}
</style>
<body>
<div class="div1">
<div class="div2"></div>
</div>
</body>
Note that I don't want an alternative way to achieve the above aesthetic but I need a proper solution while keeping the div inside a div, because my bigger project requires this structure and this code is simplified to showcase the bug. Thanks!