I try to get a very simple loading animation that is implemented with CSS.
.spinner
{
border: 5px solid red;
border-top: 5px solid green;
border-radius: 50%;
width: 30px;
height: 30px;
animation: spin 3s linear infinite;
}
@keyframes spin
{
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
123
<div class="spinner">abc</div>
987
Any way I get the text inside the spinner to be static and not turning without having another element outside the spinner?
I do not want to integrate libs for that. But I use jQuery if that helps. But it should be simple and easy.
2
Answers
You could use a wrapper element to position your elements inside it.
You can use
::before
to add a spinner around text.here is a sample code