站长技术网

首页 > 网站基础 > DIV&CSS >

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.68iis.com/d/file/pic/20240220/jcyzcy12nqi2753.jpg"></a>

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

</p>

</body>

</html>