Problem:
I shouldn't be seeing any other the underlying divs (which are of the same size as the div covering them) when they're being covered.
.gauge-wrapper {
position:relative;
margin:20px;
background-color: black;
}
.gauge-arc {
position:absolute;
top:0;
left:0;
width:100px;
height:100px;
border-radius:100%;
border:7px solid;
}
.gauge-arc1 {
border-color:red transparent transparent transparent;
transform: rotate(200deg);
}
.gauge-arc2 {
border-color:red transparent transparent transparent;
transform: rotate(180deg);
}
.gauge-arc3 {
border-color:red transparent transparent transparent;
transform: rotate(180deg);
}
.gauge-mask {
border-color: transparent transparent white transparent;
z-index:9999
}
.gauge-background {
border-color: #c3bdbd;
z-index: -1;
}
<div class="gauge-wrapper">
<div class="gauge-arc gauge-arc1"></div>
<div class="gauge-arc gauge-arc2"></div>
<div class="gauge-arc gauge-arc3"></div>
<div class="gauge-arc gauge-mask"></div>
<div class="gauge-arc gauge-background"></div>
</div>
What I've Tried:
What It Should Look Like:
There should be no outline around the top div. I'm willing to accept odd solutions that barely fix the problem. If you can find an easier way for me to do what I'm doing, great, but I'll still want to know how to address this specific issue with HTML/CSS.
If you use box sizing you can make the mask 2px larger and in turn give it a 2px thicker border and that should cover your below arcs:
* {
box-sizing: border-box; /* makes squares same size no matter padding and border */
}
.gauge-wrapper {
width: 102px; /* give this width and height (optional) otherwise it will take no space as everything inside is positioned absolutely */
height: 102px;
position: relative;
margin: 20px;
}
.gauge-arc {
position: absolute;
top: 1px; /* start these 1px inside so outer circle is "larger" and will cover */
left: 1px;
width: 100px;
height: 100px;
border-radius: 50%;
border: 7px solid;
}
.gauge-arc1 {
border-color: red transparent transparent transparent;
transform: rotate(200deg);
}
.gauge-arc2 {
border-color: red transparent transparent transparent;
transform: rotate(180deg);
}
.gauge-arc3 {
border-color: red transparent transparent transparent;
transform: rotate(180deg);
}
.gauge-mask {
top: 0;
left: 0;
width: 102px;
height: 102px;
border: 9px solid;
border-color: transparent transparent white transparent;
z-index: 9999
}
.gauge-background {
border-color: #c3bdbd;
z-index: -1;
}
<div class="gauge-wrapper">
<div class="gauge-arc gauge-arc1"></div>
<div class="gauge-arc gauge-arc2"></div>
<div class="gauge-arc gauge-arc3"></div>
<div class="gauge-arc gauge-mask"></div>
<div class="gauge-arc gauge-background"></div>
</div>