To implement some fantastic rounds of execution, I used an element with a border radius and overflow: hidden. Everything looks great except for one: all browsers display a thin line where the overflow ends.
Here are some simple snippets that reproduce this error in all major browsers:
function setMarginLeft(value){
var element = document.querySelector(".overflowing");
element.style.marginLeft = value+"px";
}
function setMarginTop(value){
var element = document.querySelector(".overflowing");
element.style.marginTop = value+"px";
}
.backdrop {
background-color: white;
padding: 10px;
width:100px;
height:100px;
}
.circle {
background-color: red;
width:100px;
height:100px;
border-radius: 100px;
overflow:hidden;
}
.overflowing {
width:200px;
height:200px;
margin-top: -1px;
margin-left:1px;
background-color:#fff;
}
input {
margin-top:10px;
}
<div class="backdrop">
<div class="circle">
<div class="overflowing"></div>
</div>
</div>
<em>Feel free to play around with these values:</em><br />
Top margin: <input type="number" id="cngMargin" oninput="setMarginTop(this.value)" value="-1"><br />
Left margin: <input type="number" id="cngMargin" oninput="setMarginLeft(this.value)" value="1">
Run codeHide resultsince the layout is not as simple as the above snippet, I cannot change the layout much. I assume that the main problem is antialiasing the browser, which I think is not changed by css, or is it?
I was looking stupidly in this matter and could not come up with really useful stories. I think if nothing works, I will have to do it again in SVG or on canvas .-