<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>闪光效果</title> | |
<style type="text/css"> | |
*{ | |
padding:0; | |
margin:0; | |
width: 100%; | |
} | |
.box{ | |
width: 400px; | |
height: 400px; | |
margin: 100px auto; | |
position: relative; | |
overflow: hidden; | |
} | |
.flash{ | |
position: absolute; | |
left:-165px; | |
top:0px; | |
width: 20px; | |
height: 400px; | |
background:-webkit-linear-gradient(left,transparent,rgba(255,255,255,0.5),transparent); | |
transform:skew(-30deg); | |
} | |
.box:hover .flash{ | |
left: 510px; | |
transition: all 1s; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="box"> | |
<img src="doller.jpg"> | |
<div class="flash"></div> | |
</div> | |
</body> | |
</html> |
图片闪光效果(纯css)
最新推荐文章于 2024-08-14 09:51:23 发布