Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I make different shape from css?

Tags:

html

css

enter image description here

Can I make this shape from css?

.shape {
  margin: 40px;
  height: 40px;
  width: 100px;
  border-radius: 50px;
  background: #333;
  position: relative;
}


.shape:before {
  height: 80px;
  width: 80px;
  border-radius: 100%;
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #333;
}
<div class="shape"></div>

1 Answers

This is what you are looking for

.shape {
  margin: 40px;
  height: 40px;
  width: 110px;
  border-radius: 50px;
  background: #333;
  position: relative;
}

.shape:before {
  height: 80px;
  width: 80px;
  border-radius: 100%;
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #333;
}

.shape:after {
  height: 40px;
  width: 121px;
  border-radius: 90%;
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #333;
}
<div class="shape"></div>
like image 112
Sanchit Patiyal Avatar answered Dec 02 '25 03:12

Sanchit Patiyal



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!