css之文字连续光影特效、动画、scss

文章目录

  • 效果图
  • html
  • scss
  • css


效果图

css之文字连续光影特效、动画、scss_第1张图片


html

<div>
	<span>Cspan>
	<span>Ospan>
	<span>Lspan>
	<span>Ospan>
	<span>Rspan>
	<span>Fspan>
	<span>Uspan>
	<span>Lspan>
div>

scss

body {
    background-color: #696969;
    text-align: center;
}

span {
    color: #faebd7;
    font-size: 68px;
    font-weight: 700;
    animation: spread 1s ease-in-out infinite alternate;
}

@keyframes spread {
    to {
        color: #ff0266;
        text-shadow: 20px 0 70px #ff0266;
    }
}

@for $i from 1 through 8 {
    span:nth-child(#{$i}) {
        animation-delay: ($i - 1) * 0.2s;
    }
}

css

body {
  background-color: #696969;
  text-align: center;
}

span {
  color: #faebd7;
  font-size: 68px;
  font-weight: 700;
  animation: spread 1s ease-in-out infinite alternate;
}

@keyframes spread {
  to {
    color: #ff0266;
    text-shadow: 20px 0 70px #ff0266;
  }
}

span:nth-child(1) {
  animation-delay: 0s;
}

span:nth-child(2) {
  animation-delay: 0.2s;
}

span:nth-child(3) {
  animation-delay: 0.4s;
}

span:nth-child(4) {
  animation-delay: 0.6s;
}

span:nth-child(5) {
  animation-delay: 0.8s;
}

span:nth-child(6) {
  animation-delay: 1s;
}

span:nth-child(7) {
  animation-delay: 1.2s;
}

span:nth-child(8) {
  animation-delay: 1.4s;
}

你可能感兴趣的:(web前端,CSS,HTML,css,scss,前端)