2017-10-13 133 views
1

我想下面的图像旋转360度及以下应用了图像的CSS:Spining不适用于手机为什么?

<img src="" alt="" /> 

CSS:

.image { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    width: 120px; 
    height: 120px; 
    margin:-60px 0 0 -60px; 
    -webkit-animation:spin 4s linear infinite; 
    -moz-animation:spin 4s linear infinite; 
    animation:spin 4s linear infinite; 
} 
@-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } } 
@-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } } 
@keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } } 

其桌面上工作良好,但无法在手机上?如果我做错了什么?

+1

什么是移动浏览器? – Justinas

+0

.. – Sangrai

+0

将手机连接到PC,并使用普通浏览器devtools检查元素。 – Justinas

回答

1

这对我来说都适用于手机和台式机。

.loader { 
    position: absolute; 
    width: 120px; 
    height: 120px; 
    left: 0; right: 0; 
    top: 0; bottom: 0; 
    margin: auto; 
    max-width: 100%; 
    max-height: 100%; 
    overflow: hidden; 
    -webkit-animation: spin 4s linear infinite; 
    animation: spin 4s linear infinite; 
} 

@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
} 
0

你的旋转代码可能不起作用,因为你没有正确编码。动画中存在一些问题。

SEE THE EXAMPLE

相关问题