It's hard for me to make this preloader animation in CSS.
This is what I am trying to do.

What am I doing wrong?
.l { animation: pulse .8s infinite linear; } .m { animation: pulse .8s infinite linear; animation-delay: .2s; } .r { animation: pulse .8s infinite linear; animation-delay: .4s; } @keyframes pulse { 0% { padding: 8px; } 50% { padding: 16px; } 100% { padding: 8px; } }
html, body { height: 100%; } .table { display: table; width: 100%; height: 100%; text-align: center; } .cell { display: table-cell; vertical-align: middle; } .circle { display: inline-block; padding: 8px; margin: 0 0.6em; background: #000; border-radius: 100%; } .l { animation: pulse .8s infinite linear; } .m { animation: pulse .8s infinite linear; animation-delay: .2s; } .r { animation: pulse .8s infinite linear; animation-delay: .4s; } @keyframes pulse { 0% { padding: 8px; } 50% { padding: 16px; } 100% { padding: 8px; } }
<div class="table"> <div class="cell"> <div class="circle l"></div> <div class="circle m"></div> <div class="circle r"></div> </div> </div>
source share