我創建了一個小提琴,但我不認爲它正確顯示。 http://jsfiddle.net/kVNQb/,但無論如何查看代碼可能都很有用。使用背景圖片並在其頂部應用CSS動畫
我使用一個CSS動畫從此站點http://cssdeck.com/labs/css3-snow
我想要做的是設置一個背景圖片,然後讓雪動畫在此之上建立的雪。此刻,我失去了動畫雪或背景圖像。
我需要創建一個ID並設置我想要的圖像作爲背景嗎?
HTML代碼
<body>
<div class="row">
<div class="large-12 columns">
<div id="container">
</div>
</div>
</div>
</body>
CSS代碼
/*Custom CSS styles being used on top of the standard Foundation 4 style sheet*/
fixed.body {
background-image: url(http://s17.postimg.org/9htu61zjj/background.jpg);
}
* {
margin: 0;
padding: 0;
}
a {
color: white;
font-style: italic;
}
/*Keyframes*/
@keyframes snow {
0% { background-position: 0px 0px, 0px 0px, 0px 0px }
100% { background-position: 500px 1000px, 400px 400px, 300px 300px }
}
@-moz-keyframes snow {
0% { background-position: 0px 0px, 0px 0px, 0px 0px }
100% { background-position: 500px 1000px, 400px 400px, 300px 300px }
}
@-webkit-keyframes snow {
0% { background-position: 0px 0px, 0px 0px, 0px 0px }
50% { background-color: #b4cfe0 }
100% {
background-position: 500px 1000px, 400px 400px, 300px 300px;
background-color: #6b92b9;
}
}
@-ms-keyframes snow {
0% { background-position: 0px 0px, 0px 0px, 0px 0px }
100% { background-position: 500px 1000px, 400px 400px, 300px 300px }
}
/*body {
background-color: #6b92b9;
background-image: url('http://img138.imageshack.us/img138/5230/snowh.png'), url('http://img594.imageshack.us/img594/9146/snow3q.png'), url('http://img196.imageshack.us/img196/5065/snow2l.png');
-webkit-animation: snow 20s linear infinite;
-moz-animation: snow 20s linear infinite;
-ms-animation: snow 20s linear infinite;
animation: snow 20s linear infinite;
}*/
#container {
width: 800px;
margin: 200px auto;
text-align: center;
color: white;
font: 100px/1 'Spirax', cursive;
text-shadow: 0px 0px 4px rgba(0,0,0, 0.5);
}
#container p { font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif }
看起來在這裏很好:http://www.liveweave.com/vxMq6X – silicakes