How To Create a CSS Loader (Spinner)

I will show you how to build loader css or Spinner without using photos. Using a spinner image that is done either with a gif image or with Javascript. But now I’m demonstrating that yon can build loader or spinner using CSS animations.

You Can use below Example to use To Create a Loader (Spinner) using css.

Example

Css Code


.loader {
  border: 16px solid #f3f3f3;
  border-radius: 50%;
  border-top: 16px solid blue;
  border-bottom: 16px solid blue;
  width: 120px;
  height: 120px;
  -webkit-animation: spin 2s linear infinite;
  animation: spin 2s linear infinite;
}

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

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

Html Code

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

Leave a Reply

Your email address will not be published. Required fields are marked *