【发布时间】:2014-02-18 10:45:18
【问题描述】:
我试图使这些信息块的大小相同,而不管每个信息块包含多少字。如示例所示,当一个块的文本比另一个块少时,一个会变小一点,而另一个则保持不同的大小。
现在我的问题是,无论内容或图像如何,如何使这些块具有相同的大小?我还将在它们正下方使用另一对。
这是 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>
我在这里可能做错了什么?
【问题讨论】: