码迷,mamicode.com
首页 > Web开发 > 详细

网站logo扫光效果CSS实现代码

时间:2020-05-28 23:10:32      阅读:80      评论:0      收藏:0      [点我收藏+]

标签:str   fun   comm   pretty   href   实现   一个   pos   bsp   

例如:

<div class="logo">
<a  href="#" rel="home" itemprop="url">
<img src="图片地址" alt="logo" itemprop="logo" width="150" height="50">
</a>
</div>
  • 1
  • 2
  • 3
  • 4
  • 5

CSS样式:

/**logo扫光效果CSS**/
#logo:before{  /**根据logo外div样式名称修改before前名称**/
    content:"";
    position: absolute;
    left: -665px; /**第一个数字参数控制扫光速度,数字越大越慢**/
    top: -460px;
    width: 200px;
    height: 10px; /**光标的宽度,可根据实际调整**/
    background-color: rgba(255,255,255,.5);
    -webkit-transform: rotate(-45deg);
    -moz-transform: rotate(-45deg);
    -ms-transform: rotate(-45deg);
    -o-transform: rotate(-45deg);
    transform: rotate(-45deg);
    -webkit-animation: searchLights 1s ease-in 1s infinite;
    -o-animation: searchLights 1s ease-in 1s infinite;
    animation: searchLights 1.5s ease-in 1s infinite;/**第一个数字参数控制扫光速度,数字越大越慢**/
}
@-webkit-keyframes searchLights {
    0% { left: -100px; top: 0; }
    to { left: 120px; top: 100px; }
}
@-o-keyframes searchLights {
    0% { left: -100px; top: 0; }
    to { left: 120px; top: 100px; }
}
@-moz-keyframes searchLights {
    0% { left: -100px; top: 0; }
    to { left: 120px; top: 100px; }
}
@keyframes searchLights {
    0% { left: -100px; top: 0; }
    to { left: 120px; top: 100px; }
}

 

演示网站:https://leffz.com

网站logo扫光效果CSS实现代码

标签:str   fun   comm   pretty   href   实现   一个   pos   bsp   

原文地址:https://www.cnblogs.com/shaoyi7/p/12984433.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!