2014-03-13 20 views
0

我有3個不同高度的容器,我想將它們水平堆疊,小盒子在底部。我該如何解決它? enter image description hereCSS盒不會排在頂部

這裏是我使用的框的代碼:

.brand{ 
border: 1px solid black; 
border-radius: 6px; 
-webkit-border-radius: 6px; 
-moz-border-radius: 5px; 
padding: 9px; 
margin-top: 10px; 
background-image: url('/pcbuilds/assets/images/squared_metal.png'); 
margin-left: auto; 
margin-right: auto; 
display: inline-block; 
width: 200px; 
} 
+0

Coul你是否也提供HTML代碼?沒有它,我們真的不能做很多事情。 – Joeytje50

+1

添加垂直對齊:頂部,否則他們站在基線上,並在視覺上與底部對齊 –

+0

@GCyrillus它的工作!發佈它作爲答案,所以我可以投票:) –

回答

3

vertical-align具有用於內聯和內聯boxe內容,defaut vertical-align值爲baseline

.brand{ 
border: 1px solid black; 
border-radius: 6px; 
-webkit-border-radius: 6px; 
-moz-border-radius: 5px; 
padding: 9px; 
margin-top: 10px; 
background-image: url('/pcbuilds/assets/images/squared_metal.png'); 
margin-left: auto; 
margin-right: auto; 
display: inline-block; 
vertical-align:top; 
width: 200px; 
} 
0

你不能只是把

position:relative; 
top:0px;