Loader Animation using HTML & CSS

Loader Animation using HTML & CSS

 Hello developers, today in this blog, you'll learn to create a Loader Animation using HTML & CSS.

Loaders are also called preloaders, are what you see on the screen while the page's content is still loading. Loaders are simple and complex animations that are used to keep your visitors and content viewers entertained while the page's content is still loading.

In this blog (Loader Animation) on the webpage, there are three circles that rotate alternatively, this loader rotates 360 degrees. After a single rotation, the loader stops for a second and it loads again. The CSS @keyframe property is used to rotate the loader.

The source code of this Loader Animation is given below, if you want the source code of this program, you can copy it. You can use this Loader Animation with your creativity and can take this project to the next level.

Loader Animation [Source Code]

To make this website, you would like to make two files: an HTML file & a CSS file. First, create an HTML file with the name of index.html and remember, you have to create a file with a .html extension.

<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <title>Loader circle animation || Learningrobo</title> <link rel="stylesheet" href="./style.css"> </head> <body> <section class="loader"> <div class="circle"></div> <div class="circle"></div> <div class="circle"></div> </section> <div class="credit">Made with <span style="color:tomato;font-size:20px;">❤</span> by <a href="https://www.learningrobo.com/">Learning Robo</a></div> </body> </html>
CSS provides style to an HTML page. To make the page attractive, create a CSS file with the name style.css, and remember that you have to make a file with a .css extension.


html, body{
margin: 0%;
background-color: #12192c;
}

.loader{
  width: 100%;
  height: 90vh;
  position: relative;
  top: 0;
  left: 0;
  background-color: #12192c;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loader .circle{
  width: 150px;
  height: 150px;
  border-radius: 50%;

  position: absolute;
  
    animation: spin 1s ease-in-out infinite;
}

.loader .circle:nth-child(1){
  border-top: 1px solid #887fff;

}


.loader .circle:nth-child(2){
  border-bottom: 1.5px solid #fff;
  width: 120px;
  height: 120px;
}

.loader .circle:nth-child(3){
  border-left: 2px solid blueviolet;
  width: 180px;
  height: 180px;
}

@keyframes spin{
  from{transform: rotate(0deg)}
  to{transform: rotate(720deg)}
}
.credit a{
  text-decoration: none;
  color: #887fff;
  font-weight: 800;
  }
  
  .credit {
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    margin: 10px;
    color:#fff;
    text-align: center;
  }
We hope you would like this Loader Animation using HTML & CSS.

Thank you for reading our blog. If you face any problem creating this Loader Animation using HTML & CSS, then contact us or comment us. We'll try to provide the solution to your problem as soon as possible.

Thank you
Learning robo team

إرسال تعليق

Thank you
Learning robo team

Post a Comment (0)

أحدث أقدم
Learning Robo says...
code copied
Welcome