JSFiddle - React, Tailwind, and code Playground
by Nesvet
HTML
<span class="spinner"></span>
CSS
html {
background: hsl(200, 50%, 90%);
text-align: center;
}
.spinner {
display: block;
width: 35px;
height: 35px;
margin: 80px 150px;
position: relative;
border: 2px solid rgba(0,0,0,0.5);
border-top-color: transparent;
border-bottom-color: transparent;
border-radius: 100%;
-webkit-animation: spin 1s infinite linear;
-moz-animation: spin 1s infinite linear;
-ms-animation: spin 1s infinite linear;
-o-animation: spin 1s infinite linear;
animation: spin 1s infinite linear;
}
.spinner:after {
content: '';
display: block;
width: 0;
height: 0;
position: absolute;
top: -6px;
left: 3px;
border: 6px solid transparent;
border-bottom-color: rgba(0,0,0,0.5);
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
.spinner:before {
content: '';
display: block;
width: 0;
height: 0;
position: absolute;
bottom: -6px;
right: 3px;
border: 6px solid transparent;
border-top-color: rgba(0,0,0,0.5);
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
@-webkit-keyframes spin {
to { -webkit-transform: rotate(360deg); }
}
@-moz-keyframes spin {
to { -moz-transform: rotate(360deg); }
}
@-ms-keyframes spin {
to { -ms-transform: rotate(360deg); }
}
@-o-keyframes spin {
to { -o-transform: rotate(360deg); }
}
@keyframes spin {
to { transform: rotate(360deg); }
}