61,115
社区成员
发帖
与我相关
我的任务
分享
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>水平滚动图片</title>
<style>
* {border:0; margin:0; padding:0;}
</style>
</head>
<body>
<div id="scroller">
<div id="images">
<a href="http://www.baidu.com"><img width="150px" height="150px" /></a>
<a href="http://www.baidu.com"><img width="150px" height="150px" /></a>
<a href="http://www.baidu.com"><img width="150px" height="150px" /></a>
<a href="http://www.baidu.com"><img width="150px" height="150px" /></a>
<a href="http://www.baidu.com"><img width="150px" height="150px" /></a>
</div>
<div>
<img width="150px" height="150px" />
<img width="150px" height="150px" />
</div>
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
.box{width:100px;height:100px;background:#ccc; display:inline-block;}
</style>
</head>
<body>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
</body>
</html>
<div id="images">
<a href="http://www.baidu.com"><img width="150px" height="150px" /></a><a href="http://www.baidu.com"><img width="150px" height="150px" /></a><a href="http://www.baidu.com"><img width="150px" height="150px" /></a><a href="http://www.baidu.com"><img width="150px" height="150px" /></a><a href="http://www.baidu.com"><img width="150px" height="150px" /></a>
</div>
或者直接设置浮动
img{float:left;}