所以我有一个大的 div 标签。用于此的 css 样式是:
.thumbcontainer {
width: 900px;
margin-top: 0px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
display: block;
overflow: hidden;
}
我有 4 个 div 标签。他们的 CSS 样式:
.thumbnails {
float: left;
margin-top: auto;
margin-right: 10px;
margin-bottom: auto;
margin-left: 10px;
}
最后是代码:
<div class="thumbcontainer">
<div class="thumbnails">
<a href="gallery/1.jpg" style="" rel="lightbox[gallery]"><img src="gallery/1-thumbnail.jpg" width="150" height="112" alt=""/></a>
</div>
<div class="thumbnails">
<a href="gallery/2.jpg" rel="lightbox[gallery]"><img src="gallery/2-thumbnail.jpg" width="150" height="112" alt=""/></a>
</div>
<div class="thumbnails">
<a href="gallery/3.jpg" rel="lightbox[gallery]"><img src="gallery/3-thumbnail.jpg" width="150" height="112" alt=""/></a>
</div>
<div class="thumbnails">
<a href="gallery/4.jpg" rel="lightbox[gallery]"><img src="gallery/4-thumbnail.jpg" width="150" height="112" alt=""/></a>
</div>
</div> <!-- End of thumbcontainer div -->
它可以工作,但是它们之间显然都与 20(10x2) 像素对齐。我尝试将拇指容器更改为文本中心对齐并没有做任何事情。