html5 css3蓝天白云,Css3画蓝天白云

云的画法:一个圆形和两个长方形

43357cffa581

蓝天白云.png

蓝天白云

/*清除元素默认边距*/

* {

margin: 0;

padding: 0;

}

/*蓝天草地全屏显示,二者高度比为6:4*/

.world {

position: relative;

width: 100vw;

height: 100vh;

background: -webkit-gradient(linear, 0 0, 0 100%, from(rgb(196, 228, 253)), color-stop(0.6, rgb(255, 255, 255)), to(rgb(148, 190, 89)));

background: -webkit-linear-gradient(rgb(196, 228, 253), rgb(255, 255, 255) 60%, rgb(148, 190, 89));

background: -moz-linear-gradient(rgb(196, 228, 253), rgb(255, 255, 255) 60%, rgb(148, 190, 89));

background: -o-linear-gradient(rgb(196, 228, 253), rgb(255, 255, 255) 60%, rgb(148, 190, 89));

background: linear-gradient(rgb(196, 228, 253), rgb(255, 255, 255) 60%, rgb(148, 190, 89));

}

/*利用边框绘制云彩,一个圆形,两个长方形*/

.cloud,

.cloud::before,

.cloud::after {

position: absolute;

width: 0;

height: 0;

border-radius: 100px;

box-shadow: 0px 0px 2px 2px #fff;

}

.cloud {

border: 50px solid #fff;

}

.cloud::before {

content: "";

border: 30px solid #fff;

padding-left: 20px;

-webkit-transform: rotate(45deg);

-moz-transform: rotate(45deg);

-ms-transform: rotate(45deg);

-o-transform: rotate(45deg);

transform: rotate(45deg);

top: -12px;

left: -90px;

}

.cloud::after {

content: "";

border: 24px solid #fff;

padding-left: 110px;

top: -4px;

left: -96px;

}

/*设置云彩大小,在天空中的位置,观察原图有三朵云大小基本一样,取奇数减少代码量*/

.cloud:nth-child(odd) {

-webkit-transform: scale(.7);

-moz-transform: scale(.7);

-ms-transform: scale(.7);

-o-transform: scale(.7);

transform: scale(.7);

}

.cloud:nth-child(1) {

top: 1vh;

left: 40vw;

}

.cloud:nth-child(3) {

top: 20vh;

left: 45vw;

}

.cloud:nth-child(2) {

top: 10vh;

left: 55vw;

}

.cloud:nth-child(4) {

top: 15vh;

left: 65vw;

-webkit-transform: scale(.5);

-moz-transform: scale(.5);

-ms-transform: scale(.5);

-o-transform: scale(.5);

transform: scale(.5);

}

.cloud:nth-child(5) {

top: 3vh;

left: 75vw;

}

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值