1. 效果图
2. 代码
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>css3动画-图片开关灯阴影效果</title>
<style type="text/css">
ul,li{list-style: none;}
.toppic li{
width: 280px;height: 160px;
float: left;background: #000;
overflow: hidden;margin: 10px;
}
.toppic li img{width: 100%;height: 100%;}
.toppic li i {
display: block;
opacity: 0.7;
-moz-transition: all .5s ease;
-webkit-transition: all .5s ease;
-ms-transition: all .5s ease;
-o-transition: all .5s ease;
transition: all .5s ease;
overflow: hidden;
}
.toppic li:hover i {
opacity: 1;
}
</style>
</head>
<body>
<ul class="toppic">
<li><i><img src="images/toppic01.jpg"></i></li>
<li><i><img src="images/toppic02.jpg"></i></li>
</ul>
</body>
</html>
以上就是关于“ CSS3动画 - 图片开关灯阴影动画 ” 的全部内容。