CSS Animation from Left to Right

后端 未结 5 712
生来不讨喜
生来不讨喜 2021-02-08 11:55

I am trying to make an animation in CSS. I read some examples of it online and I cannot figure out what I\'m doing wrong... I want my potato image to go from left t

5条回答
  •  梦如初夏
    2021-02-08 12:25

    you have to use only the 'left' not the 'right' parameter on your keyframe. You have also some typo on your css, the 'scale' seems useless too.

    #pot{
        bottom:15%;
        position:absolute;
        -webkit-animation:linear infinite alternate;
        -webkit-animation-name: run;
        -webkit-animation-duration: 5s;
    }     
    @-webkit-keyframes run {
        0% { left: 0;}
        50%{ left : 100%;}
        100%{ left: 0;}
    }
    

    like : online version

提交回复
热议问题