2013-04-18 55 views
0

图像容器我有以下的图像容器:固定大小

<div class="images"> 
    <img src="<%=imageURL %>" /> 
</div> 

而对于.images的CSS是:

.images{ 
display:inline-block; 
width:100px; 
height:133px; 
overflow:hidden; 
} 

我的图片具有不同的尺寸这就是为什么我使用上述DIV胶囊,使他们相同的大小。但在页,我的图片来是这样的:

enter image description here

其顶部不对齐。我该如何纠正?

回答

2

添加vertical-align:top

.images{ 
    display:inline-block; 
    width:100px; 
    height:133px; 
    overflow:hidden; 
    vertical-align:top 
} 
+0

感谢。这工作。 – soundswaste

0

使用浮动

.images{ 
     float:left; 
     width:100px; 
     height:133px; 
     overflow:hidden; 
     }