成人午夜视频全免费观看高清-秋霞福利视频一区二区三区-国产精品久久久久电影小说-亚洲不卡区三一区三区一区

CSS怎么實(shí)現(xiàn)貨車(chē)loader的效果

這篇“CSS怎么實(shí)現(xiàn)貨車(chē)loader的效果”除了程序員外大部分人都不太理解,今天小編為了讓大家更加理解“CSS怎么實(shí)現(xiàn)貨車(chē)loader的效果”,給大家總結(jié)了以下內(nèi)容,具有一定借鑒價(jià)值,內(nèi)容詳細(xì)步驟清晰,細(xì)節(jié)處理妥當(dāng),希望大家通過(guò)這篇文章有所收獲,下面讓我們一起來(lái)看看具體內(nèi)容吧。

創(chuàng)新互聯(lián)建站是一家集網(wǎng)站建設(shè),龍巖企業(yè)網(wǎng)站建設(shè),龍巖品牌網(wǎng)站建設(shè),網(wǎng)站定制,龍巖網(wǎng)站建設(shè)報(bào)價(jià),網(wǎng)絡(luò)營(yíng)銷(xiāo),網(wǎng)絡(luò)優(yōu)化,龍巖網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強(qiáng)企業(yè)競(jìng)爭(zhēng)力??沙浞譂M(mǎn)足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時(shí)我們時(shí)刻保持專(zhuān)業(yè)、時(shí)尚、前沿,時(shí)刻以成就客戶(hù)成長(zhǎng)自我,堅(jiān)持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實(shí)用型網(wǎng)站。

代碼解讀

定義dom,容器代表卡車(chē),包含的2個(gè)子元素代表車(chē)頭和尾氣;<hr>代表道路:

<divclass="truck">

<spanclass="cab"></span>

<spanclass="smoke"></span>

</div>

<hr>

居中顯示,同時(shí)道路與頁(yè)面之間留出空間:

body{

margin:10%;

padding-top:10%;

}

畫(huà)出卡車(chē)車(chē)廂:

.truck{

width:15em;

height:5em;

font-size:10px;

background-color:#444;

border-radius:0.4em;

}

用偽元素畫(huà)出車(chē)廂的車(chē)輪:

.truck{

position:relative;

}

.truck::before,

.truck::after{

content:'';

position:absolute;

box-sizing:border-box;

width:2em;

height:2em;

background-color:#444;

border:0.1emsolidwhite;

border-radius:50%;

bottom:-1em;

}

.truck::before{

left:0.6em;

}

.truck::after{

right:0.6em;

}

畫(huà)出車(chē)頭:

.cab{

position:absolute;

width:3.3em;

height:2.5em;

background-color:#333;

left:-3.5em;

bottom:0;

border-radius:40%00.4em0.4em;

}

.cab::before{

content:'';

position:absolute;

width:2em;

height:1.5em;

background-color:#333;

top:-1.5em;

right:0;

border-radius:100%000;

}

畫(huà)出車(chē)頭的車(chē)輪:

.cab::after{

content:'';

position:absolute;

box-sizing:border-box;

width:2em;

height:2em;

background-color:#444;

border:0.1emsolidwhite;

border-radius:50%;

bottom:-1em;

left:0.5em;

}

畫(huà)出尾氣的初始狀態(tài):

.smoke,

.smoke::before,

.smoke::after{

content:'';

position:absolute;

width:1em;

height:1em;

background-color:#333;

right:-0.1em;

bottom:-0.5em;

border-radius:50%;

}

增加排出尾氣的動(dòng)畫(huà):

.smoke{

animation:smoke-12sinfinite;

}

.smoke::before{

animation:smoke-22sinfinite;

}

.smoke::after{

animation:smoke-32sinfinite;

}

@keyframessmoke-1{

to{

width:3em;

height:3em;

right:-3em;

bottom:0.5em;

}

}

@keyframessmoke-2{

to{

width:2.5em;

height:2.5em;

right:-6em;

bottom:0.8em;

}

}

@keyframessmoke-3{

to{

width:3.5em;

height:3.5em;

right:-4em;

bottom:0.2em;

}

}

增加尾氣的飄散效果:

.smoke{

animation:

drift2sinfinite,

smoke-12sinfinite;

}

.smoke::before{

animation:

drift3sinfinite,

smoke-23sinfinite;

}

.smoke::after{

animation:

drift4sinfinite,

smoke-34sinfinite;

}

@keyframesdrift{

0%,100%{

filter:opacity(0);

}

15%{

filter:opacity(0.9);

}

}

增加卡車(chē)行駛的動(dòng)畫(huà)效果:

.truck{

animation:

move5sinfinite;

}

@keyframesmove{

0%{

margin-left:90%;

}

50%{

margin-left:45%;

}

100%{

margin-left:0;

}

0%,100%{

filter:opacity(0);

}

10%,90%{

filter:opacity(1);

}

}

增加卡片行駛中顛簸的動(dòng)畫(huà)效果:

.truck{

animation:

put-put2sinfinite,

move10sinfinite;

}

@keyframesput-put{

0%{

margin-top:0;

height:5em;

}

5%{

margin-top:-0.2em;

height:5.2em;

}

20%{

margin-top:-0.1em;

height:5em;

}

35%{

margin-top:0.1em;

height:4.9em;

}

40%{

margin-top:-0.1em;

height:5.1em;

}

60%{

margin-top:0.1em;

height:4.9em;

}

75%{

margin-top:0;

height:5em;

}

80%{

margin-top:-0.4em;

height:5.2em;

}

100%{

margin-top:0.1em;

height:4.9em;

}

}



CSS怎么實(shí)現(xiàn)貨車(chē)loader的效果

css的三種引入方式

1.行內(nèi)樣式,最直接最簡(jiǎn)單的一種,直接對(duì)HTML標(biāo)簽使用style=""。2.內(nèi)嵌樣式,就是將CSS代碼寫(xiě)在之間,并且用

進(jìn)行聲明。3.外部樣式,其中鏈接樣式是使用頻率最高,最實(shí)用的樣式,只需要在之間加上

就可以了。其次就是導(dǎo)入樣式,導(dǎo)入樣式和鏈接樣式比較相似,采用@import樣式導(dǎo)入CSS樣式表,不建議使用。

感謝您的閱讀,希望您對(duì)“CSS怎么實(shí)現(xiàn)貨車(chē)loader的效果”這一關(guān)鍵問(wèn)題有了一定的理解,具體使用情況還需要大家自己動(dòng)手實(shí)驗(yàn)使用過(guò)才能領(lǐng)會(huì),快去試試吧,如果想閱讀更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!

文章標(biāo)題:CSS怎么實(shí)現(xiàn)貨車(chē)loader的效果
文章路徑:http://jinyejixie.com/article38/pgiopp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站改版、網(wǎng)站設(shè)計(jì)、ChatGPT、響應(yīng)式網(wǎng)站App開(kāi)發(fā)、云服務(wù)器

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(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è)
扶沟县| 宁强县| 和平县| 法库县| 荥阳市| 蒙山县| 正安县| 册亨县| 永德县| 徐闻县| 荥阳市| 高阳县| 留坝县| 察隅县| 龙海市| 阿克陶县| 中西区| 富民县| 柘城县| 定西市| 泰州市| 昆明市| 右玉县| 应城市| 武安市| 沭阳县| 亳州市| 许昌县| 安仁县| 周至县| 西吉县| 怀来县| 灯塔市| 东港市| 五台县| 宿迁市| 如东县| 饶阳县| 二连浩特市| 余姚市| 海伦市|