Flexible ellipses

In this example below you will see how to do a Flexible ellipses with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by anSullivan12, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright anSullivan12 ©
  • HTML
  • CSS
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>Flexible ellipses</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <div class="ellipse"></div>
<div class="half-ellipse"></div>
<div class="quarter-ellipse"></div>
  
  

</body>

</html>

/*Downloaded from https://www.codeseek.co/anSullivan12/flexible-ellipses-JRkKpJ */
div {
  height: 150px;
  width: 200px;
  display: inline-block;
}
.ellipse {
  background-color: gold;
  border-radius: 50%;
}
.half-ellipse {
  background-color: rebeccapurple;
  border-radius: 50% / 100% 100% 0 0;
}
.quarter-ellipse {
  background-color: yellowgreen;
  border-radius: 100% 0 0 0;
}

Comments