DEV Community

Discussion on: Build your CSS loader with only one div — The Dots

Collapse
 
afif profile image
Temani Afif

A div, a span or any element can be your loader. We generally inject such element dynamically as a position:absolute element inside another element to create a loading effect and as you said a handler will later remove it.
You can also work by adding a class to the element that will trigger the creation of the loader inside a pseudo element then remove it when the work is done, ex: codepen.io/t_afif/pen/QWgaLmN

Some comments have been hidden by the post's author - find out more