0

Here is the code snippet. I am getting a square spinner instead of a circle

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.loader {
  border: 16px solid #f3f3f3;
  border-radius: 50%;
  border-top: 16px solid #3498db;
  width: 120px;
  height: 120px;
  border-image: linear-gradient(to right, #646871 , #333333) 1;
  -webkit-animation: spin 2s linear infinite; /* Safari */
  animation: spin 2s linear infinite;
}

/* Safari */
@-webkit-keyframes spin {
  0% { -webkit-transform: rotate(0deg); }
  100% { -webkit-transform: rotate(360deg); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
</style>
</head>
<body>

<h2>How To Create A Loader</h2>

<div class="loader"></div>

</body>
</html>

Here is the code snippet. I am getting a square spinner instead of a circle

jay rangras
  • 105
  • 1
  • 1
  • 11
  • border-image and border-radius don't combine in the way you need. See https://stackoverflow.com/questions/62052199/border-radius-with-border-image?msclkid=48cae646aa7611ec840a02119a91481b where there are links to a heap of useful stuff to help you get round this. – A Haworth Mar 23 '22 at 07:00

0 Answers0