CSS3 Multiple transforms

前端 未结 2 1411
栀梦
栀梦 2021-01-19 14:45

I have a css3 animation, im using the code below to rotate a cube on the X-axis.

@-webkit-keyframes spin2 {
from { -webkit-transform: rotateX(135deg); }
to           


        
相关标签:
2条回答
  • 2021-01-19 15:22

    This should work:

        .yourElement {
            -webkit-animation:spin 4s infinite;
        }
        @-webkit-keyframes spin {
          from {
            -webkit-transform: rotateX(135deg) rotateY(135deg);
          }
          to {
            -webkit-transform: rotateX(855deg) rotateY(855deg);
          }
        }
    

    Sample: http://jsfiddle.net/KRYRk/1/

    0 讨论(0)
  • 2021-01-19 15:26

    You can use several transform functions in the transform property by separating them with a space:

    @-webkit-keyframes spin2 {
        from {
            -webkit-transform: rotateX(135deg) rotateY(135deg);
        }
        to   {
            -webkit-transform: rotateX(855deg) rotateY(855deg);
        }
    }
    
    0 讨论(0)
提交回复
热议问题