Show Loading Icon When Button Is Disabled #195
CSS showing loading animation when the button is in a disabled state
Adding these style CSS buttons to your website is easier than you think. Simply copy and paste the CSS code provided with each button design into your stylesheet
Preview Button Style
You can view the default style of buttons, the disabled state mode style of buttons, and the full-width block style of the button here. Some buttons style may not display in full width format
Button Source Code HTML and CSS
Click the button below to download the source code or edit it live.
To copy this click on the icon at the top right of the code box
.btn-195 {
--icon_color: #ffffff;
color: white;
background: #aa04f7;
font-weight: 500;
border-radius: 05px;
font-size: 16px;
padding: 13px 15px;
border: none;
font-family: Arial, Helvetica, sans-serif;
cursor: pointer;
text-decoration: none;
user-select: none;
display: inline-flex;
justify-content: center;
align-items: center;
gap: 8px 8px;
/*** full width block ***/
/* width: 100%; */
}
.btn-195:hover {
background-color: #4400fd;
}
.btn-195:active {
transform: scale(.99);
}
@keyframes pulse_195 {
0%,
100% {
transform: scale(.5);
}
50% {
transform: scale(1.2);
}
}
/*** disabled style ***/
.btn-195:disabled {
pointer-events: none;
opacity: .65;
color: #ffffff;
box-shadow: none;
text-shadow: none;
background: #aa04f7;
}
/*** button icon ***/
.btn-195:disabled::before {
content: "";
display: inline-block;
width: 15px;
height: 15px;
border-radius: 50%;
animation: pulse_195 1s infinite;
border: solid 2px var(--icon_color);
background: transparent;
}