2013-10-22 389 views
1

我正在旋转容器。 其实我已经做了..但有问题:背景图像被加载了一半(容器被加载了一半)。CSS背景图像旋转

的代码是:提前

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

.ornament { 
position:absolute; 
top:0; 
left:0; 
right:0; 
bottom:0; 
width:100%; 
height:100%; 
display:block; 
z-index: -1; 
} 


.ornament { 
background:transparent url('images/ornament.png') no-repeat; 
background-size: 100%; 
z-index: -1; 
-moz-animation: rotate-ornament 100s linear infinite; 
-ms-animation: rotate-ornament 100s linear infinite; 
-o-animation: rotate-ornament 100s linear infinite; 
-webkit-animation: rotate-ornament 100s linear infinite; 
animation: rotate-ornament 100s linear infinite; 
} 

谢谢!

+0

我想你将不得不尝试解释更详细的问题,因为我已经访问了链接并且无法看到问题出现在哪里。 – dav1dsm1th

+0

http://industrial-city.com/test/images/ornament.png –

+0

我需要这个图像(无切割)在背景中旋转.. –

回答

2

的问题是height:100%

我改变了格“.ornament”的那个高度(通过Chrome检查),背景图像(1386px)的实际高度,它工作正常。

+0

非常酷的网站布局的方式! –

+0

感谢评论:)在这种情况下(身高:1386px)它工作正常,但网站有大溢出 - Ÿ..我想如何隐藏它 –