当前位置 : 主页 > 网站建设 > 正文

博客logo图片一闪而过CSS特效

网摘

重庆seo2017-01-17 23:58:42阅读()CSSA+ / A-

博客logo图片一闪而过CSS特效

       有朋友问我要重庆SEO博客的logo图片一闪而过的动态效果,这个其实也是找来的,作为好学的前端,就分享给大家。

一闪而过CSS

       用到了伪类before,CSS3的animation。

<!DOCTYPE html>
<html>
<head>
<title>图片效果</title>
<style type="text/css">
.banner{overflow:hidden;}
.banner img{float:left;width:200px;height:55px;background:none}
.banner img:hover{width:201px;height:56px}
.banner .logo{display:block;float:left;width:200px; height:50px}
.banner .logo:before{
content:"";
position: absolute;
left: -600px;
top: -600px;
width: 200px;
height: 15px;outline:px solid red;
background-color: rgba(255,255,255,.6);
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
-webkit-animation: searchLights 2s ease-in 2s infinite;
-o-animation: searchLights 2.s ease-in 2s infinite;
animation: searchLights 2s ease-in 2s infinite;
}
@-webkit-keyframes searchLights {
0% { left: -200px; top: 0; }
to { left: 220px; top: 100px; }
}
@-o-keyframes searchLights {
0% { left: -200px; top: 0; }
to { left: 220px; top: 100px; }
}
@-moz-keyframes searchLights {
0% { left: -200px; top: 0; }
to { left: 220px; top: 100px; }
}
@keyframes searchLights {
0% { left: -200px; top: 0; }
to { left: 220px; top: 100px; }
}
</style>
</head>
<body>
 <div class="banner">
  <h1>
   <a href="http://www.vi586.com" class="logo">
    <img src="http://www.vi586.com/images/logo.png" height="54" width="216" alt="重庆SEO吖七">
   </a>
  </h1>
 </div>
</body>
</html>

    扩展阅读

    本文地址:https://www.vi586.com/web/368.html
    版权声明:网摘,版权归原作者所有

    赞(1)