Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS half arch around full circle

Tags:

css

css-shapes

I am trying to create a half arch around a full circle like below. How would I create this in css? So far I have only created the circle but no idea how to do the arch.

Arch Circle

.circle {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  font-size: 20px;
  color: #fff;
  line-height: 45px;
  text-align: center;
  position: relative;
  background: #BDBDBD;
}
<div class="circle">1</div>
like image 202
Ka Tech Avatar asked Dec 09 '25 12:12

Ka Tech


1 Answers

You can use :after pseudo-element to create half circle. You also need to use bottom-right and top-right border-radius.

.circle {
  width: 100px;
  height: 100px;
  margin: 50px;
  position: relative;
  line-height: 100px;
  text-align: center;
  border-radius: 50%;
  background: #BDBDBD;
  color: white;
}

.circle:after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  border: 10px solid gray;
  border-left: 0;
  border-bottom-right-radius: 100px;
  border-top-right-radius: 100px;
  width: 55px;
  height: calc(100% + 10px);
  transform: translate(15px, -15px);
}
<div class="circle">1</div>
like image 84
Nenad Vracar Avatar answered Dec 12 '25 03:12

Nenad Vracar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!