- <!doctype html>
- <html>
- <head lang="en">
- <meta charset="UTF-8">
- <title>CSS3 闪光动画 </title>
- <style type="text/css">
- .overimg{
- position: relative;
- display: block;
- /*overflow:hidden;*/
- box-shadow: 0 0 10px #fff;
- }
- .light{
- cursor: pointer;
- position: absolute;
- left: -180px;
- top: 0;
- width: 580px;
- height: 200px;
- background-image: -moz-linear-gradient(0deg,rgba(255,255,255,0),rgba(255,255,255,0.5),rgba(255,255,255,0));
- background-image: -webkit-linear-gradient(0deg,rgba(255,255,255,0),rgba(255,255,255,0.5),rgba(255,255,255,0));
- transform: skewx(-25deg);
- -o-transform: skewx(-25deg);
- -moz-transform: skewx(-25deg);
- -webkit-transform: skewx(-25deg);
- }
- .overimg:hover .light{
- left:180px;
- -moz-transition:0.5s;
- -o-transition:0.5s;
- -webkit-transition:0.5s;
- transition:0.5s;
- }
- </style>
- </head>
- <body>
- <p class="overimg">
- <a><img src="http://b.hiphotos.baidu.com/ting/pic/item/738b4710b912c8fcd79e6d8afb039245d6882103.jpg"></a>
- <i class="light"></i>
- </p>
- </body>
- </html>
来源: http://www.qdfuns.com/article/19431/2daf47276ee6409bffdeb8194d069934.html