css3划过图片闪光

css代码

01 .img { display:blockpositionrelativewidth:800pxheight:450pxmargin:0 auto;}
02 .img:before { content""positionabsolutewidth:200pxheight100%top0left:-150pxoverflowhidden;
03 background: -moz-linear-gradient(left, rgba(255,255,255,0)0, rgba(255,255,255,.2)50%, rgba(255,255,255,0)100%);
04 background: -webkit-gradient(linear, left topright top, color-stop(0%, rgba(255,255,255,0)), color-stop(50%, rgba(255,255,255,.2)), color-stop(100%, rgba(255,255,255,0)));
05 background: -webkit-linear-gradient(left, rgba(255,255,255,0)0, rgba(255,255,255,.2)50%, rgba(255,255,255,0)100%);
06 background: -o-linear-gradient(left, rgba(255,255,255,0)0, rgba(255,255,255,.2)50%, rgba(255,255,255,0)100%);
07 -webkit-transform: skewX(-25deg);
08 -moz-transform: skewX(-25deg)
09 }
10 .img:hover:before { left150%; transition: left 1s ease 0s; }

html代码

01 <a href="#" class="img"><img src="http://img.loveqiao.com/pic1.jpg" width="800"></a>
 
posted @ 2016-10-27 17:18  幸福的目标  阅读(536)  评论(0编辑  收藏  举报