css3 to achieve flash effect

<!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>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324755375&siteId=291194637