欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

css3實現(xiàn)簡單的白云飄動背景特效

  發(fā)布時間:2020-10-28 17:26:30   作者:螞蟻開源社區(qū)   我要評論
這篇文章主要介紹了css3實現(xiàn)簡單的白云飄動背景特效的示例,幫助大家制作網(wǎng)頁特效,美化自己的網(wǎng)站,感興趣的朋友可以了解下

這是一款非常簡單的純CSS3白云飄動背景特效。該白云飄動特效使用CSS animation動畫來控制不同的白云,以不同的速度進行運動,形成白云飄動的效果。

HTML結(jié)構(gòu)

該白云飄動特效的HTML結(jié)果非常簡單,使用一個<div>來包裹一組作為白云的<div>元素。

<div id="clouds">
<div class="cloud x1"></div>
<div class="cloud x2"></div>
<div class="cloud x3"></div>
<div class="cloud x4"></div>
<div class="cloud x5"></div>
</div>

CSS樣式

白云使用.cloud 和它的:before和:after偽元素來制作。

.cloud {
width: 200px; height: 60px;
background: #fff;
border-radius: 200px;
-moz-border-radius: 200px;
-webkit-border-radius: 200px;
position: relative;
}
.cloud:before, .cloud:after {
content: '';
position: absolute;
background: #fff;
width: 100px; height: 80px;
position: absolute; top: -15px; left: 10px;
border-radius: 100px;
-moz-border-radius: 100px;
-webkit-border-radius: 100px;
-webkit-transform: rotate(30deg);
transform: rotate(30deg);
-moz-transform: rotate(30deg);
}
.cloud:after {
width: 120px; height: 120px;
top: -55px; left: auto; right: 15px;
}

每一朵白云都執(zhí)行moveclouds動畫,但是它們的動畫速度各不相同。大小和透明度也各不相同。

.x1 {
-webkit-animation: moveclouds 15s linear infinite;
-moz-animation: moveclouds 15s linear infinite;
-o-animation: moveclouds 15s linear infinite;
}
.x2 {
left: 200px;
-webkit-transform: scale(0.6);
-moz-transform: scale(0.6);
transform: scale(0.6);
opacity: 0.6; /*opacity proportional to the size*/
/*Speed will also be proportional to the size and opacity*/
/*More the speed. Less the time in 's' = seconds*/
-webkit-animation: moveclouds 25s linear infinite;
-moz-animation: moveclouds 25s linear infinite;
-o-animation: moveclouds 25s linear infinite;
}
......
@-webkit-keyframes moveclouds {
0% {margin-left: 1000px;}
100% {margin-left: -1000px;}
}
@-moz-keyframes moveclouds {
0% {margin-left: 1000px;}
100% {margin-left: -1000px;}
}
@-o-keyframes moveclouds {
0% {margin-left: 1000px;}
100% {margin-left: -1000px;}
}

以上就是css3實現(xiàn)簡單的白云飄動背景特效的詳細內(nèi)容,更多關(guān)于CSS3特效的資料請關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

  • css3實現(xiàn)背景圖片半透明內(nèi)容不透明的方法示例

    這篇文章主要介紹了css3實現(xiàn)背景圖片半透明內(nèi)容不透明的方法示例,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小
    2021-04-13
  • css3實現(xiàn)背景圖片顏色修改的多種方式

    這篇文章主要介紹了css3實現(xiàn)背景圖片顏色修改的多種方式,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起
    2021-04-13
  • css3制作的背景漸變動畫效果

    這篇文章主要介紹了css3實現(xiàn)的加載動畫效果,幫助大家更好的利用css3制作網(wǎng)頁,感興趣的朋友可以了解下
    2021-04-07
  • CSS3實現(xiàn)模糊背景的三種效果示例

    這篇文章主要介紹了CSS3實現(xiàn)模糊背景的三種效果示例,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)
    2021-03-29
  • CSS3 菱形拼圖實現(xiàn)只旋轉(zhuǎn)div 背景圖片不旋轉(zhuǎn)功能

    這篇文章主要介紹了CSS3 菱形拼圖實現(xiàn)只旋轉(zhuǎn)div 背景圖片不旋轉(zhuǎn)功能,本文給大家介紹的非常詳細,對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2021-03-29
  • CSS3只讓背景圖片旋轉(zhuǎn)180度的實現(xiàn)示例

    這篇文章主要介紹了CSS3只讓背景圖片旋轉(zhuǎn)180度的實現(xiàn)示例。文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一
    2021-03-09
  • 基于css3制作的圓形透明畫中畫視頻播放特效

    圓形透明畫中畫視頻播放特效是一款基于css3制作的創(chuàng)意透明圓形層mp4視頻播放特效代碼。
    2020-12-17
  • JS+CSS3文章內(nèi)容背景黑白切換特效代碼

    JS+CSS3文章內(nèi)容背景黑白切換特效代碼是一款基于JS+CSS3制作的簡單網(wǎng)頁文章文字內(nèi)容背景顏色黑白切換效果。
    2020-11-27
  • CSS3 實現(xiàn)的動態(tài)星空背景

    這篇文章主要介紹了CSS3 實現(xiàn)的動態(tài)星空背景的示例代碼,幫助大家更好的理解和學(xué)習(xí)制作CSS3特效,感興趣的朋友可以了解下
    2021-04-22

最新評論