首页 > 代码库 > css3划过图片闪光

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>
 

css3划过图片闪光