How to make a Loader in CSS

 Make a awesome CSS Loader - 



Make a Loader in CSS


HTML - 

<!DOCTYPE html>

<html>

<head>

<title>Loader</title>

<link rel="stylesheet" type="text/css" href="style.css">

</head>

<body>


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


</body>

</html>


CSS -

*{

margin: 0;

padding: 0;

box-sizing: border-box;

}

body{

height: 100vh;

background: #999;

display: flex;

justify-content: center;

align-items: center;

}

.loader{

width: 200px;

height: 200px;

border: 20px solid white;

border-radius: 50%;

border-top: 20px solid black;

box-shadow: 0 0 5px rgba(0,0,0,0.2),

0 0 10px rgba(0,0,0,0.25),

0 0 15px rgba(0,0,0,0.3);

animation: animate 2s linear infinite;

}

@keyframes animate{

from{

transform: rotate(0deg);

}

to{

transform: rotate(360deg);

}

}


Comments