<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="css/index.css" >
</head>
<body>
<div class="container">
<div class="box">
<img src="img/2.jpg" title="" alt="" class="img_1" >
<img src="img/1.jpg" title="" alt="" class="img_0" >
<p class="title" >图片_1</p>
</div>
<div class="box">
<img src="img/2.jpg" title="" alt="" class="img_1" >
<img src="img/1.jpg" title="" alt="" class="img_0" >
<p class="title" >图片_1</p>
</div>
<div class="box">
<img src="img/2.jpg" title="" alt="" class="img_1" >
<img src="img/1.jpg" title="" alt="" class="img_0" >
<p class="title" >图片_1</p>
</div>
<div class="box">
<img src="img/2.jpg" title="" alt="" class="img_1" >
<img src="img/1.jpg" title="" alt="" class="img_0" >
<p class="title" >图片_1</p>
</div>
</div>
</body>
</html>
* {
margin:0;
padding:0;
}
.container {
width:1200px;
height:500px;
border:1px solid #000;
}
.box {
width:20%;
height:300px;
border:1px solid #fff;
float:left;
margin-right:5px;
position:relative;
}
.box:hover {
border:1px solid red;
cursor:pointer;
color:red;
}
.box:hover .img_0 {
display:none;
}
img {
width:90%;
height:90%;
position:absolute;
left:5%;
}
.title {
text-align:center;
position:relative;
top:90%;
}