css-6 df15,CSS3 六边形渐变色背景

CSS

语言:

CSSSCSS

确定

html,

body {

width: 200%;

height: 100%;

margin: 0;

padding: 0;

background: #000;

overflow: hidden;

}

.hex:before {

content: '';

width: 0;

height: 0;

border-bottom: 30px solid #0df2df;

border-left: 52px solid transparent;

border-right: 52px solid transparent;

position: absolute;

top: -30px;

animation: hexagon2 30s linear infinite;

}

.hex {

margin-top: 30px;

width: 104px;

height: 60px;

background-color: #0df2df;

position: relative;

float: left;

margin-left: 6px;

margin-bottom: -24px;

animation: hexagon 30s linear infinite;

}

.hex:after {

content: '';

width: 0;

position: absolute;

bottom: -30px;

border-top: 30px solid #0df2df;

border-left: 52px solid transparent;

border-right: 52px solid transparent;

animation: hexagon3 30s linear infinite;

}

.hex-row:first-child {

clear: left;

margin-top: -80px;

margin-left: -53px;

}

.hex-row:nth-child(even) {

padding-top: 30px;

margin-left: -106px;

clear: left;

}

.hex-row:nth-child(odd) {

padding-top: 30px;

margin-left: -53px;

clear: left;

}

@keyframes hexagon {

0%, 100% {

background-color: #f3f;

transform: rotate(0deg) scale(1);

}

25%,

75% {

background-color: rgba(153, 255, 204, .2);

transform: rotate(180deg) scale(2);

}

50% {

background-color: rgba(255, 54, 51, .5);

transform: rotate(360deg) scale(1.5);

}

}

@keyframes hexagon2 {

0%, 100% {

border-bottom-color: #f3f;

}

25%,

75% {

border-bottom-color: rgba(153, 255, 204, .2);

}

50% {

border-bottom-color: rgba(255, 54, 51, .5);

}

}

@keyframes hexagon3 {

0%, 100% {

border-top-color: #f3f;

}

25%,

75% {

border-top-color: rgba(153, 255, 204, .2);

}

50% {

border-top-color: rgba(255, 54, 51, .5);

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值