您的位置
主页 > 网站技术 > CSS/HTML > » 正文

css特效 一道闪光在图片上划过代码

来源: 站长圈 点击:

复制代码  代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml"> 

<head> 

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 

<title>闪光图片</title> 

<style> 

.overimg{ 

position: relative; 

display: block; 

/* overflow: hidden; */ 

box-shadow: 0 0 10px #FFF; 

.light{ 

cursor:pointer; 

position: absolute; 

left: -180px; 

top: 0; 

width: 180px; 

height: 90px; 

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://www.nowamagic.net/librarys/images/201402/2014_02_15_01.jpg"></a> 

<i class="light"></i> 

</p> 

</body> 

</html> 




首页  - 关于站长圈  - 广告服务  - 联系我们  - 关于站长圈  - 网站地图  - 版权声明