How To Create A Loader Using Only HTML and CSS?



To create a loader like this by using only HTML and CSS. 

 

STEP 1:

Create an HTML file and type this code.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Loading</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="loader"></div>
</body>
</html>  

 

STEP 2:

Create a CSS file and type this  code.

.loader{
    width: 70px;
    height: 70px;
    border: 10px solid rgb(207, 207, 207);
    border-top: 10px solid red;
    border-radius: 50%;
    margin: auto;
    position: relative;
    top: 250px;
    animation-name: loader;
    animation-timing-function: linear;
    animation-duration: 1s;
    animation-iteration-count: infinite;
}
@keyframes loader{
    0%{
        transform: rotateZ(0deg);
    }
    100%{
        transform:rotateZ(360deg);
    }

Output

Copy the code from Our Github


Trending Posts

What Are The Use of Function Keys F1 to F12 on The Keyboard?

When You Should Buy a New Smartphone? Right Time To Upgrade A Smartphone?

How Long Does It Take to Learn Web Development?

Computer Hardware and Software

Sunrise And Sunset Animation Using HTML & CSS?

Recent CrowdStrike Update Causes Big Tech Outage: What Happened and What We Can Learn

5 Mistakes You Should Never Do On The Internet

OPPO New Rollable Smartphone - OPPO X 2021

Starting Secure: Essential Data Protection Tips for New Entrepreneurs

5 Awesome Computer Shortcut Key Tricks You Must Try