简体   繁体   English

全屏旋转背景图像

[英]Fullscreen spinning background image

i've been looking everywhere how to achieve this effect of an animated spinning image that is covering the whole screen. 我一直在到处寻找如何实现覆盖整个屏幕的动画旋转图像的效果。 Like this one . 喜欢这个

bassically, what i want is to make it spin and to be fullscreen. 令人费解的是,我想要使它旋转并全屏显示。

this is what i got so far, http://losmosca.com.ar/reiki/ 这是我到目前为止所获得的, http://losmosca.com.ar/reiki/

HTML: HTML:

<img src="img/bg.jpg" id='test' class='rotating'>

CSS3: CSS3:

#test {
position:relative;
margin:0 auto;
width:1000px;
height:1000px;
}

@-webkit-keyframes rotating {
     from{
        -webkit-transform: rotate(0deg);
     }
     to{
        -webkit-transform: rotate(360deg);
     }
}

.rotating {
    -webkit-animation: rotating 1000s linear infinite;
}

as you can see, i can make it spin but not fullscreen, is it possible? 如您所见,我可以使其旋转但不能全屏显示,这可能吗? thank you! 谢谢!

Try using width:100%; 尝试使用width:100%; rather than width:1000px; 而不是width:1000px;

and height:100% rather than height:1000px; height:100%而不是height:1000px;

Cool effect by the way, I may have to find an excuse to use that trick. 顺便说一句,效果很酷,我可能不得不找借口使用该技巧。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM