>  기사  >  웹 프론트엔드  >  CSS3实现的字符串逐字高亮效果代码实例_html/css_WEB-ITnose

CSS3实现的字符串逐字高亮效果代码实例_html/css_WEB-ITnose

WBOY
WBOY원래의
2016-06-24 11:32:252139검색

CSS3实现的字符串逐字高亮效果代码实例:
本章节分享一段代码实例,它实现了字符串逐字高亮效果。
代码如下:

<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="author" content="http://www.softwhy.com/" /><title>蚂蚁部落</title><style type="text/css">html, body{  background-color: #aaaaaa;}p span{  font-family: 'Comic Sans MS';  animation: loading 1.4s;  -moz-animation: loading 1.4s;  -webkit-animation: loading 1.4s;  animation-iteration-count: infinite;  -webkit-animation-iteration-count: infinite;}@keyframes loading{  0% {color: black;}  75% {color: black;}  100% {color: white;}}@-moz-keyframes loading {  0% {color: black;}  75% {color: black;}  100% {color: white;}}@-webkit-keyframes loading{  0% {color: black;}  75% {color: black;}  100% {color: white;}}.word1{  animation-delay:-1.2s;  -webkit-animation-delay:-1.2s;}.word2{  animation-delay:-1s;  -webkit-animation-delay:-1s;}.word3{  animation-delay:-0.8s;  -webkit-animation-delay:-0.8s;}.word4{  animation-delay:-0.6s;  -webkit-animation-delay:-0.6s; }.word5{  animation-delay:-0.4s;  -webkit-animation-delay:-0.4s;}.word6{  animation-delay:-0.2s;  -webkit-animation-delay:-0.2s; }.word7{  animation-delay:0s;  -webkit-animation-delay:0s; }</style></head><body><div style="width:200px;margin:0 auto;"><p>  <span class="word1">L</span>  <span class="word2">O</span>  <span class="word3">A</span>  <span class="word4">D</span>  <span class="word5">I</span>  <span class="word6">N</span>  <span class="word7">G</span></p></div></body></html>

原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=17250

更多内容可以参阅:http://www.softwhy.com/shili/

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.