实例参考本站
将以下代码放入style.css
/*Logo添加闪光效果*/
.logo {
position: relative;
font-size:2em;
font-weight:700;
line-height:39px;
overflow:hidden;
margin:0;
}
.logo::before {
content:"";
position: absolute;
width: 150px;
height: 10px;
background-color: rgba(255, 255, 255, .5);
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
-webkit-animation: searchLights 1.5s ease-in 1.5s infinite;
animation: searchLights 1.5s ease-in 1.5s infinite;
}
@-webkit-keyframes searchLights {
0% {
left: -90px;
top: 0;
}
to {
left: 90px;
top: 0;
}
}
/*代码结束*/