2013-06-29 3 views
1

body 태그가있는 CSS 배경 애니메이션을 만들려고합니다. 코드는 다음과 같습니다CSS 배경 이미지 애니메이션이 작동하지 않습니다

그러나 내가 사용하는 배경은 흰색에서 파란색으로 바래니다. 이미지가 표시되지 않는 이유가 있습니까? 그리고 방법에 의해 이미지 디렉토리가 정확하고 그냥 배경 이미지로 설정하면 작동합니다.

+0

그리고 HTML을 코드 - 시도 <링크 확인해 = "스타일"유형 = "텍스트/CSS는"HREF = "desktop.css"> user2072017

+0

사용'edit' 버튼 질문에 더 많은 콘텐츠를 추가 할 수 있습니다. 이렇게하면 형식을 올바르게 지정할 수 있습니다. –

답변

0

배경 이미지는 애니메이션으로 만들 수있는 속성이 아니며 속성을 트위닝 할 수 없습니다. 따라서 키 프레임 애니메이션과 함께 사용할 수 없습니다. 대신이를 heres

<!DOCTYPE html> 
<html> 
<head> 
<style type="text/css"> 
body 
{background:url('Space.png');} 

#frame 
{ 
position: absolute; 
z-index: -1; 
top: 0; 
left: 0; 
height: 100%; /* or the height of webpage is px */ 
width: 100%; /* or the width of webpage is px */ 
animation-name:mymove; 
animation-duration:5s; 
animation-direction:alternate; 
animation-iteration-count:infinite; 
-webkit-animation-name:mymove; 
-webkit-animation-duration:5s; 
-webkit-animation-direction:alternate; 
-webkit-animation-iteration-count:infinite; 
} 
@keyframes mymove 
{ 
from {background:transparent;} 
to {background:blue;} 
} 
@-webkit-keyframes mymove 
{ 
from {background:transparent;} 
to {background:blue;} 
} 
</style> 
</head> 
<body> 
<div id="frame"> 
<--- Webpage contents ---> 
</div> 
</body> 
</html> 
+0

정말 고마운 친구, 정말 도움이되었습니다. 지금은 완벽하게 작동합니다! – user2072017

+0

그래도 두 이미지로 작동합니까? – user2072017

+1

한 이미지에서 다른 이미지로 말하고 싶습니까? 예, 그럴 수 있습니다. – Sid

관련 문제