怎么在css中設(shè)置元素一直旋轉(zhuǎn)

這期內(nèi)容當(dāng)中小編將會(huì)給大家?guī)?lái)有關(guān)怎么在css中設(shè)置元素一直旋轉(zhuǎn),文章內(nèi)容豐富且以專業(yè)的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。

創(chuàng)新互聯(lián)公司專業(yè)為企業(yè)提供同仁網(wǎng)站建設(shè)、同仁做網(wǎng)站、同仁網(wǎng)站設(shè)計(jì)、同仁網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁(yè)設(shè)計(jì)與制作、同仁企業(yè)網(wǎng)站模板建站服務(wù),十余年同仁做網(wǎng)站經(jīng)驗(yàn),不只是建網(wǎng)站,更提供有價(jià)值的思路和整體網(wǎng)絡(luò)服務(wù)。

css設(shè)置元素一直旋轉(zhuǎn)的方法:首先創(chuàng)建一個(gè)HTML示例文件;然后用img引入圖片;最后使用css樣式“transform:rotate(360deg)”設(shè)置元素旋轉(zhuǎn)360度,并通過(guò)animation-duration屬性設(shè)置動(dòng)畫時(shí)長(zhǎng)即可。

HTML代碼:

<div class="demo">
<img class="an img" src="1.jpg" width="400" height="400"/>

css圖片旋轉(zhuǎn)360度的動(dòng)畫代碼示例如下:

.demo{text-align: center;
    margin-top: 100px;}
@-webkit-keyframes rotation{
    from {-webkit-transform: rotate(0deg);}
    to {-webkit-transform: rotate(360deg);}
}
.an{
    -webkit-transform: rotate(360deg);
    animation: rotation 3s linear infinite;
    -moz-animation: rotation 3s linear infinite;
    -webkit-animation: rotation 3s linear infinite;
    -o-animation: rotation 3s linear infinite;
}
.img{border-radius: 200px;}

效果圖:

怎么在css中設(shè)置元素一直旋轉(zhuǎn)

上述就是小編為大家分享的怎么在css中設(shè)置元素一直旋轉(zhuǎn)了,如果剛好有類似的疑惑,不妨參照上述分析進(jìn)行理解。如果想知道更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。

網(wǎng)頁(yè)題目:怎么在css中設(shè)置元素一直旋轉(zhuǎn)
轉(zhuǎn)載來(lái)于:http://muchs.cn/article24/ippcje.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供服務(wù)器托管、網(wǎng)站設(shè)計(jì)公司、網(wǎng)站建設(shè)、定制開(kāi)發(fā)、網(wǎng)站設(shè)計(jì)、定制網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站建設(shè)