4
A
回答
3
<!DOCTYPE html>
<html>
<head>
<style>
div
{
width:100px;
height:100px;
background:red;
animation:myfirst 7s; /* IE 10+ */
-moz-animation:myfirst 7s; /* Firefox */
-webkit-animation:myfirst 7s; /* Safari and Chrome */
-o-animation:myfirst 7s; /* Opera */
-webkit-animation-fill-mode: forwards;
-moz-animation-fill-mode: forwards;
-o-animation-fill-mode: forwards;
animation-fill-mode: forwards;
}
@keyframes myfirst
{
from {opacity: 1;}
99%{opacity: 1;}
to {opacity:0;}
}
@-moz-keyframes myfirst /* Firefox */
{
from {opacity: 1;}
99%{opacity: 1;}
to {opacity:0;}
}
@-webkit-keyframes myfirst /* Safari and Chrome */
{
from {opacity: 1;}
99%{opacity: 1;}
to {opacity:0;}
}
@-o-keyframes myfirst /* Opera */
{
from {opacity: 1;}
99%{opacity: 1;}
to {opacity:0;}
}
</style>
</head>
<body>
<div>hello world</div>
</body>
</html>
3
設置你的關鍵幀,其持續時間,開始前的延遲,並指示它保留其最後的值:
#foo {
animation: fademe 1s 7s forwards
}
@keyframes fademe {
to { opacity: 0 }
}
筆:http://codepen.io/joe/pen/mkwxi
此代碼示例不包含任何必需的供應商前綴。要按原樣運行,您應該考慮使用無前綴:http://leaverou.github.com/prefixfree/。
0
使用animation屬性的組合,具體而言,animation-name
,animation-duration
,animation-iteration-count
,animation-delay
和animation-fill-mode
您還需要-webkit-
,-moz-
,-o-
和一致性-ms-
(雖然IE10我相信沒有作品供應商前綴)每次animation
風格
animation-name:bubbly; /* name of keyframe animation (note @keyframe blocks need vendor prefixes also (atm) */
animation-duration:0.9s; /* how long the keyframe takes to run */
animation-iteration-count:1; /* how many times to run the keyframe */
animation-delay:7s; /* how long before the keyframe starts running */
animation-fill-mode:forwards; /* which styles to apply once the keyframe is done */
或者在一個animation
統計總結EMENT
animation: bubbly 0.9s 7s 1 forwards;
而且關鍵幀
@keyframes bubbly {
from {opacity:1;}
to {opacity: 0;}
}
jsfiddle example(與供應商前綴)
相關問題
- 1. CSS DIV隱藏內容
- 2. 在容器中顯示和隱藏DIV
- 3. 點擊隱藏容器div
- 4. CSS:兩個容器中,在全寬(每個容器可隱藏)
- 5. 隱藏內容,而在CSS
- 6. 在隱藏div中隱藏div?
- 7. 隱藏內容而不隱藏div?
- 8. 如何在WordPress中隱藏div類? CSS
- 9. 在css中使用@media隱藏div類
- 10. 容器溢出左側的div結構和CSS:隱藏
- 11. 在Dynamics CRM中隱藏div內容
- 12. 根據時間戳隱藏div容器
- 13. CSS隱藏div無效?
- 14. 顯示隱藏JS div css
- 15. CSS在div容器中從左到右動畫文字,隱藏溢出
- 16. 內容DIV隱藏頁腳
- 17. Div無內容隱藏
- 18. 使用js和css隱藏/顯示div中的內容
- 19. 如何隱藏在CSS一個div
- 20. 如何隱藏的div在CSS
- 21. 在另一個容器中顯示/隱藏div
- 22. ExtJS。隱藏容器
- 23. 隱藏在一個div舊內容
- 24. div在使用jQuery顯示和隱藏div後沒有通過CSS隱藏
- 25. CSS中心容器div
- 26. 容器和div中的CSS
- 27. 在顯示/隱藏div中顯示/隱藏div
- 28. 隱藏div如果容器div具有較少的構造者
- 29. 谷歌地圖div,由容器div隱藏
- 30. 在JavaScript中隱藏div類?
請發表您的代碼中的問題。 – jrummell