博客logo图片一闪而过CSS特效
作者: 本站原创 发布时间: 浏览: 次
有朋友问我要秀站网博客的logo图片一闪而过的动态效果,这个其实也是找来的,作为好学的前端,就分享给大家。
用到了伪类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> <p 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="秀站网秀站网"> </a> </h1> </p> </body> </html>
上一篇:移动端png小图片显示模糊
下一篇:点击切换文章大小字体功能JS