我有非常基本的图片库如何将其固定为 3 列 x 2 行
这是 HTML 代码
<div id="gallery">
<div class="img">
<a target="_blank" href="klematis_big.htm"> <img src="../zeela/img/image_1.png" alt="Klematis"/> </a>
<div class="descHead">
כותרת
</div>
<div class="desc">
Add a description of the image here
</div>
</div>
<div class="img">
<a target="_blank" href="klematis2_big.htm"> <img src="../zeela/img/image_1.png" alt="Klematis" /> </a>
<div class="descHead">
כותרת
</div>
<div class="desc">
Add a description of the image here
</div>
</div>
<div class="img">
<a target="_blank" href="klematis3_big.htm"> <img src="../zeela/img/image_1.png" alt="Klematis" /> </a>
<div class="descHead">
כותרת
</div>
<div class="desc">
Add a description of the image here
</div>
</div>
<div class="img">
<a target="_blank" href="klematis4_big.htm"> <img src="../zeela/img/image_1.png" alt="Klematis" /> </a>
<div class="descHead">
כותרת
</div>
<div class="desc">
Add a description of the image here
</div>
</div>
<div class="img">
<a target="_blank" href="klematis4_big.htm"> <img src="../zeela/img/image_1.png" alt="Klematis" /> </a>
<div class="descHead">
כותרת
</div>
<div class="desc">
Add a description of the image here
</div>
</div>
<div class="img">
<a target="_blank" href="klematis4_big.htm"> <img src="../zeela/img/image_1.png" alt="Klematis" /> </a>
<div class="descHead">
כותרת
</div>
<div class="desc">
Add a description of the image here
</div>
</div>
</div>
这是CSS代码
#画廊{ } div.img { 边距:2px; 高度:自动; 宽度:自动; 浮动:对; } div.img img { 宽度:200px;/* img 的大小是多少*/ 高度:200px; 显示:内联; 左边距:30px; 右边距:30px; 边距底部:20px; 边框:1px 实心#ffffff; } /* div.img a:hover img { 边框:1px 实心#0000ff; }*/ div.desc { 文本对齐:居中; 字体粗细:正常; 宽度:120px; 边距:30px; } .descHead { 右边距:30px; 边距顶部:20px; 底部边距:15px; 字体系列:Tahoma; 字体大小:24px; 颜色:#323232; } .desc { margin-right: 30px !important; margin-bottom: 40px !important; 字体系列:Tahoma; 字体大小:14px; 颜色:#323232; }