I have the following code
#preloader {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #fff;
z-index: 100;
}
#loader {
width: 150px;
height: 150px;
position: absolute;
left: 50%;
top: 50%;
background: url(https://i.imgur.com/QRgZIhI.png) no-repeat center 0;
margin: -50px 0 0 -50px;
-webkit-animation: pulse 2s ease-in-out infinite;
/* Safari 4+ */
-moz-animation: pulse 2s ease-in-out infinite;
/* Fx 5+ */
-o-animation: pulse 2s ease-in-out infinite;
/* Opera 12+ */
animation: pulse 2s ease-in-out infinite;
/* IE 10+, Fx 29+ */
}
<div id="preloader">
<div id="loader"></div>
</div>
I want the effect to be applied animation: pulse
to the image, but I can't get it to work.
i tried with@keyframes
@-webkit-keyframes pulse {
animation: pulse 2s ease-in-out infinite }
@-moz-keyframes pulse {
animation: pulse 2s ease-in-out infinite }
@-o-keyframes pulse {
animation: pulse 2s ease-in-out infinite }
@keyframes pulse {
animation: pulse 2s ease-in-out infinite }
But it didn't work for me either.
At first I made an animated gif on a website that provided this service, but the quality is very poor, so I opted for this measure.
Thank you very much!
The ruler
@keyframes
(or path points) allows you to control the intermediate steps in a CSS animation sequence.You can use the property
transform
with the valuescale
to give the effect you are looking for.If you want the animation to go faster or slower, change the seconds value
animation
to a smaller number or a larger number, respectively.PS: It
pulse
's not a predefined value in the propertyanimation
.