So, i am making a solar system, and i am stuck at saturn. I am trying to make a ring of the saturn but i am facing an issue. So everything is done but i need to hide the border which must come at the back of the planet and also it should not be visible. So i need to hide only a paritcular part of the border.
You see the blue border, i need only enough border so that it is not visible and it must look like a saturn ring. This is just a test it is not a real project.!!
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.big {
width: 170px;
height: 170px;
background-color: teal;
border-radius: 50%;
position: relative;
left: 129px;
}
.saturn-ring {
width: 90px;
height: 90px;
border-top: 2px solid red;
border-left: 2px solid red;
border-right: 2px solid blue;
border-bottom: 2px solid blue;
transform: skew(295deg, 309deg);
border-radius: 50%;
}
<div class="big"> </div>
<div class="saturn-ring"> </div>
"I NEED THIS TO BE A SATURN RING AND I TRYING TO MAKE SATURN, SO HOW DO I DO IT???"
I tried to hide the right and bottom border but it is not helping, it hides the whole border and it leaves an uneven space which does not look like saturn:::::
3
Answers
I solved it by separating the red and blue rings and using z-index.
Here is one solution.
Create two divs, one for red and one for blue. Then position them using z-index and position relative.
try this html and css:
css: