html径向渐变怎么写彩虹,CSS3 彩虹渐变文本

这段CSS代码创建了一个动态效果,通过@import引入谷歌字体库的Raleway字体,然后应用到body背景及文字样式上。多个.wrd类元素以不同高度、颜色和动画延迟依次渐显,实现了文字逐层淡入的视觉效果。动画关键帧@keyframes fade确保了元素从透明渐变为不透明的平滑过渡。
摘要由CSDN通过智能技术生成

CSS

语言:

CSSSCSS

确定

@import url(http://fonts.googleapis.com/css?family=Raleway:400);

body {

background: #222;

height: 100vh;

width: 100vw;

overflow: hidden;

}

.wrd {

position: absolute;

text-align: center;

font-size: 120px;

margin-top: 120px;

height: 20px;

max-width: content-box;

overflow: hidden;

font-weight: bold;

padding: 0;

right: 0;

left: 0;

color: black;

line-height: 90px;

font-family: 'Raleway', sans-serif;

}

.wrd:nth-child(1) {

opacity: 0;

height: 10px;

z-index: -1;

color: #33b2cc;

-webkit-animation: fade 1s 0.2s linear alternate infinite;

animation: fade 1s 0.2s linear alternate infinite;

}

.wrd:nth-child(2) {

opacity: 0;

height: 20px;

z-index: -2;

color: #33c;

-webkit-animation: fade 1s 0.4s linear alternate infinite;

animation: fade 1s 0.4s linear alternate infinite;

}

.wrd:nth-child(3) {

opacity: 0;

height: 30px;

z-index: -3;

color: #b233cc;

-webkit-animation: fade 1s 0.6s linear alternate infinite;

animation: fade 1s 0.6s linear alternate infinite;

}

.wrd:nth-child(4) {

opacity: 0;

height: 40px;

z-index: -4;

color: #c36;

-webkit-animation: fade 1s 0.8s linear alternate infinite;

animation: fade 1s 0.8s linear alternate infinite;

}

.wrd:nth-child(5) {

opacity: 0;

height: 50px;

z-index: -5;

color: #cc8033;

-webkit-animation: fade 1s 1s linear alternate infinite;

animation: fade 1s 1s linear alternate infinite;

}

.wrd:nth-child(6) {

opacity: 0;

height: 60px;

z-index: -6;

color: #9c3;

-webkit-animation: fade 1s 1.2s linear alternate infinite;

animation: fade 1s 1.2s linear alternate infinite;

}

.wrd:nth-child(7) {

opacity: 0;

height: 70px;

z-index: -7;

color: #33cc4d;

-webkit-animation: fade 1s 1.4s linear alternate infinite;

animation: fade 1s 1.4s linear alternate infinite;

}

.wrd:nth-child(8) {

opacity: 0;

height: 80px;

z-index: -8;

color: #3cc;

-webkit-animation: fade 1s 1.6s linear alternate infinite;

animation: fade 1s 1.6s linear alternate infinite;

}

.wrd:nth-child(9) {

opacity: 0;

height: 90px;

z-index: -9;

color: #334dcc;

-webkit-animation: fade 1s 1.8s linear alternate infinite;

animation: fade 1s 1.8s linear alternate infinite;

}

@-webkit-keyframes fade {

100% {

opacity: 1;

}

}

@keyframes fade {

100% {

opacity: 1;

}

}

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值