我正在处理一个图片库,我在对齐图片下方的文本时遇到了一些问题。每当文本填满一行以上时,图像就会向上移动,这是我不想要的。这是描述问题的屏幕截图:
我已经剪掉了图片,但是你可以看到框架,所以问题应该很清楚。这是我的代码:
<table style="padding:10px; width:500px;">
<tr>
<td style="padding-right:10px;">
<div style="width:150px; margin-left:0px;" class="photo_frame">
<a href="album.php?id=1" title=""><img width="150px" src=
"images/photos/thumb_6512bd43d9caa6e02c990b0a82652dca.jpg" alt=
"" /></a>
</div>
<p class="photo_total" style="margin-left:2px;"><a class=
"album_title" href="album.php?id=1">test</a><br />
22 photos.</p>
</td>
<td style="padding-right:10px;">
<div style="width:150px; margin-left:0px;" class="photo_frame">
<a href="album.php?id=2" title=""><img width="150px" src=
"images/photos/thumb_d82c8d1619ad8176d665453cfb2e55f0.jpg" alt=
"" /></a>
</div>
<p class="photo_total" style="margin-left:2px;"><a class=
"album_title" href="album.php?id=2">Here's an test album</a><br />
8 photos.</p>
</td>
<td style="padding-right:10px;">
<div style="width:150px; margin-left:0px;" class="photo_frame">
<a href="album.php?id=3" title=""><img width="150px" src=
"images/photos/thumb_fc490ca45c00b1249bbe3554a4fdf6fb.jpg" alt=
"" /></a>
</div>
<p class="photo_total" style="margin-left:2px;"><a class=
"album_title" href="album.php?id=3">AzaraT @ Static
Underground</a><br />
3 photos.</p>
</td>
</tr>
</table>
CSS:
.album_title {
font-weight:bold;
font-size:10px;
}
.photo_total {
margin-top:5px;
font-size:10px;
color:#969696;
}
有什么提示吗? 谢谢:D
最佳答案
没关系在 tds 上设置这个 css 工作:
vertical-align: top;
关于html - 对齐问题(图片+文字),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4986080/