我試圖讓這些塊的信息大小相同,無論每個人擁有多少字。如示例所示,當一個塊的文本比另一個塊的文本更少時,其中一個塊會變小一點,另一個保持不同的大小。如何讓這些HTML塊的信息保持相同的大小?
現在我的問題是,我如何實現讓這些塊的大小相同而不管其內容或圖像如何?我也會在他們的正下方使用另一對。
這裏是CSS代碼:
/***********All containers**************/
.bottomContainers{
position: absolute;
margin-left: 0%;
display: inline-box;
}
/**********Small Containers*************/
.container{
max-width: 30%;
max-height: 30%;
margin-top:5%;
margin-bottom: 5%;
margin-left: 10%;
padding-left: 2%;
padding-right: 2%;
padding-bottom: 2%;
background-color: #ecf0f1;
color: grey;
display: inline-block;
/*display: inline-block;*/
border-radius: 5px;
border-bottom: 2px solid grey;
}
下面是HTML代碼:
<div class="bottomContainers" role="moreInfo">
<!--Small Inner Containers for Information-->
<div class="container" id="firstContainer">
<br />
<center><img src="img/map.png"></center>
<br>
<article>
Some random text is in this block, It doesnt size like the next one
</article>
</div>
<div class="container" id="firstContainer">
<br />
<center><img src="img/money.png"></center>
<br>
this is another block which also doesnt scale to the other block regardless of text inside of it
</div>
什麼我可能做錯了嗎?
的可能重複[CSS - 展開子DIV高度父母的身高(http://stackoverflow.com/questions/4804581/css- expand-child-div-height-to-parents-height) – 2014-02-18 00:55:00