How to create loading buttons with CSS?

CSSWeb DevelopmentFront End Technology

Following is the code to create loading buttons with CSS −

Example

 Live Demo

<!DOCTYPE html>
<html>
<head>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
button {
   background-color: rgb(60, 24, 126);
   border: none;
   outline: none;
   color: white;
   padding: 12px 24px;
   font-size: 26px;
}
h1{
   font-size: 50px;
   font-family: monospace,sans-serif,serif;
}
i {
   margin-left: -12px;
   margin-right: 8px;
}
</style>
</head>
<body>
<h1>Loading Buttons Example</h1>
<button><i class="fa fa-spinner fa-spin"></i>Loading</button>
<button><i class="fa fa-circle-o-notch fa-spin"></i>Loading</button>
<button><i class="fa fa-refresh fa-spin"></i>Loading</button>
</body>
</html>

Output

The above code will produce the following output −

raja
Published on 08-Apr-2020 08:45:11
Advertisements