css3实现闪光效果

<!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>css3实现闪光效果</title>
<style>
.img{ position:relative;}
.mask{
background:-webkit-linear-gradient(0deg,rgba(255, 255, 255, 0),rgba(255, 255, 255, 0.7),rgba(255, 255, 255, 0));
-webkit-transform:skewx(-25deg);
-webkit-transition:all .5s;
width:150px;
height:150px;
position:absolute;
left:-150px;
top:0;
}
.img:hover .mask{
left:150px;
}
</style>
</head>

<body>
<div class="img">
<img src="http://placehold.it/150x150" />
<div class="mask"></div>
</div>
</body>
</html>

猜你喜欢

转载自www.cnblogs.com/dr-zhou/p/8921638.html