简单图片容器拉动显示效果的实现
实现效果
实现代码
<!DOCTYPE html>
<html>
<head>
<title> new document </title>
<meta charset="utf-8" />
<style>
#d1{
width:500px;
height:150px;
border:1px solid #000;
overflow-x:auto;
}
#d1>p{
width:800px;
height:100px;
}
#d1 p img{
width:100px;
height:100px;
border:1px solid #ddd;
border-radius:8px;
}
#d1 p img:hover{
border:2px solid #f00;
}
</style>
</head>
<body>
<div id="d1">
<p>
<img src="a.png" />
<img src="b.png" />
<img src="c.png" />
<img src="d.png" />
<img src="e.png" />
<img src="f.png" />
<img src="g.png" />
</p>
</div>
</body>
</html>