Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can you create an empty circle using exclusively CSS?

I would like to create an empty half circle in CSS/SASS, here’s my code snippet for the half circle, here’s the output:

.half-circle{
width: 60px; 
height: 120px; 
border-radius: 60px 0 0 60px;
background: #15DEA5;
}
<body>

<div class ="half-circle"></div>
</body>

But I want to “empty” it from the inside, here’s a screenshot of the result I want to achieve:

This half-emptied circle, yes this is from the video game Geometry Dash

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

So is it possible to create an emptied half circles in CSS?

>Solution :

 .half-circle {
        width: 60px;
        height: 120px;
        border-top-left-radius: 110px;
        border-bottom-left-radius: 110px;
        border: 10px solid gray;
        border-right: 0;
    }

HTML:

   <body>
        <div class ="half-circle"></div>
   </body>

Demo: https://jsfiddle.net/0zk8euj9/

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading