<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
}
.king {
width: 400px;
height: 100px;
}
img {
width: 100px;
height: 100px;
}
li {
list-style: none;
float: left;
}
li {
position: relative;
}
li img:nth-of-type(2) {
width: 20px;
height: 100px;
}
.big {
display: none;
}
.current .big {
display: block;
}
.small {
position: absolute;
left: 0;
top: 0;
}
</style>
</head>
<body>
<div class="king">
<ul>
<li class="current">
<a href">
<img src="./img/1.jpg" alt="" class="small"></a>
</li>
<li>
<a href">
<img src="./img/2.jpg" alt="" class="samll"></a>
</li>
<li>
<a href">
<img src="./img/3.jpg" alt="" class="small"></a>
</li>
<li>
<a href">
<img src="./img/4.jpg" alt="" class="small"></a>
</li>
</ul>
</div>
<script>
</script>
</body>
</html>
运行结果