這篇文章主要介紹css中動畫屬性如何使用,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!

一、css動畫(animation)屬性可以逐漸地從一個值變化到另一個值,比如尺寸大小、數(shù)量、百分比、位置和顏色。
二、實現(xiàn)方法:
1.定義動畫(slideOut為自定義的動畫名稱)
@-webkit-keyframes slideOut{
0%{top:-30px; opacity: 0;}
100%{top:0px; opacity: 1;}
}
@-moz-keyframes slideOut{
0%{top:-30px; opacity: 0;}
100%{top:0px; opacity: 1;}
}
@-o-keyframes slideOut{
0%{top:-30px; opacity: 0;}
100%{top:0px; opacity: 1;}
}
@-ms-keyframes slideOut{
0%{top:-30px; opacity: 0;}
100%{top:0px; opacity: 1;}
}
@keyframes slideOut{
0%{top:-30px; opacity: 0;}
100%{top:0px; opacity: 1;}
}2、調(diào)用動畫
-webkit-animation: slideOut 0.5s ease-in-out 0.3s backwards; -moz-animation: slideOut 0.5s ease-in-out 0.3s backwards; -o-animation: slideOut 0.5s ease-in-out 0.3s backwards; -ms-animation: slideOut 0.5s ease-in-out 0.3s backwards; animation: slideOut 0.5s ease-in-out 0.3s backwards;
三、動畫用到的屬性有background/border/border/box-shadow/clip/color/column/filter/flex/font/letter-spacing/line-height/margin/opacity/outline/perspective/text/vertical-align/visibility/word-spacing/z-index等等,基本上所以元素了。
以上是css中動畫屬性如何使用的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)網(wǎng)站制作公司行業(yè)資訊頻道!
分享標(biāo)題:css中動畫屬性如何使用-創(chuàng)新互聯(lián)
URL網(wǎng)址:http://chinadenli.net/article0/doooio.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供標(biāo)簽優(yōu)化、網(wǎng)站營銷、網(wǎng)站設(shè)計、響應(yīng)式網(wǎng)站、網(wǎng)站維護、網(wǎng)站改版
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容