样品:
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
#container {width:300px; overflow-x:auto; overflow-y:hidden; white-space:nowrap;}
img {border:0;}
</style>
</head>
<body>
<div id="container">
<a href="#"><img src="http://lh3.googleusercontent.com/-hUXeHq5OxEo/Thc7hFFv3gI/AAAAAAAAABQ/Yh7omR8iwzI/s800/thumb1.jpg" alt=""></a>
<a href="#"><img src="http://lh3.googleusercontent.com/-hUXeHq5OxEo/Thc7hFFv3gI/AAAAAAAAABQ/Yh7omR8iwzI/s800/thumb1.jpg" alt=""></a>
<a href="#"><img src="http://lh3.googleusercontent.com/-hUXeHq5OxEo/Thc7hFFv3gI/AAAAAAAAABQ/Yh7omR8iwzI/s800/thumb1.jpg" alt=""></a>
<a href="#"><img src="http://lh3.googleusercontent.com/-hUXeHq5OxEo/Thc7hFFv3gI/AAAAAAAAABQ/Yh7omR8iwzI/s800/thumb1.jpg" alt=""></a>
<a href="#"><img src="http://lh3.googleusercontent.com/-hUXeHq5OxEo/Thc7hFFv3gI/AAAAAAAAABQ/Yh7omR8iwzI/s800/thumb1.jpg" alt=""></a>
</div>
</body>
</html>
如何减少指向1px的链接之间的空间?
非常感谢提前!
麦克
答案 0 :(得分:1)
删除它们之间的空格。将它们全部放在一行上,否则它们之间会有一个空格。
答案 1 :(得分:1)
这应该有用:
* {padding:0;margin:0;}
div#container {overflow:auto;}
img {float:left;margin-right:1px;border:0;}
答案 2 :(得分:0)
嘿,在你的css中添加img属性vertical-align:top;
就像这样
img {
border: 0 none;
vertical-align: top;
}