css实现百叶窗效果
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>百叶窗</title>
<style>
* {margin:0;padding:0;}
body {background-color: #ccc;background:url(./img/triangles.png);}
ul,li {list-style:none;}
.container {
width: 805px;
height: 320px;
overflow: hidden;
margin:100px auto;
box-shadow: 0 0 5px #000;
}
.container li {
width: 160px;
position: relative;
float:left;
border-left:1px solid #888;
box-shadow:0 0 25px #000;
transition: all 0.5s;
}
.image_title {
background:rgba(0,0,0,.5);
position: absolute;
left:0;
bottom:0;
width: 640px;
}
.image_title a {
display: block;
color:#fff;
text-decoration: none;
padding:20px;
font-size:16px;
}
.container ul:hover li {width:40px;}
.container ul li:hover {width:640px;}
.container li img {
display:block;
}
</style>
</head>
<body>
<div class="container">
<ul>
<li>
<div class="image_title">
<a href="javascript:;">Kungfu Panda</a>
</div>
<a href="javascript:;">
<img src="./img/img1.jpg" alt="">
</a>
</li>
<li>
<div class="image_title">
<a href="javascript:;">Kungfu Panda</a>
</div>
<a href="javascript:;">
<img src="./img/img2.jpg" alt="">
</a>
</li>
<li>
<div class="image_title">
<a href="javascript:;">Kungfu Panda</a>
</div>
<a href="javascript:;">
<img src="./img/img3.jpg" alt="">
</a>
</li>
<li>
<div class="image_title">
<a href="javascript:;">Kungfu Panda</a>
</div>
<a href="javascript:;">
<img src="./img/img4.jpg" alt="">
</a>
</li>
<li>
<div class="image_title">
<a href="javascript:;">Kungfu Panda</a>
</div>
<a href="javascript:;">
<img src="./img/img5.jpg" alt="">
</a>
</li>
</ul>
</div>
</body>
</html>
本文来自博客园,作者:JackieDYH,转载请注明原文链接:https://www.cnblogs.com/JackieDYH/p/17634876.html