我有多个具有动态内容的div,并且它们都具有相同的高度。除了内容之外,提交按钮位于每个div内,直接位于内容旁边。 但我想显示按钮在div的底部。表格单元格中的内联元素的垂直对齐方式
HTML标记:
<div class="product-teaser-row">
<div class="product-teaser">
<h2>Title</h2>
<p>Content Content Content Content Content Content Content Content Content Content Content Content Content Content</p>
<button class="btn btn-grey" type="submit" name="action">Ansehen</button>
</div>
<div class="product-teaser">
<h2>Title 2</h2>
<p>Content</p>
<button class="btn btn-grey" type="submit" name="action">Ansehen</button>
</div>
</div>
CSS代码:
div.product-teaser {
border: 1px #c7d2d6 solid;
padding: 0px 10px 10px 10px;
width: 216px;
height: 100%;
display: table-cell;
}
div.product-teaser-row {
display: table;
border-collapse: separate;
border-spacing: 10px;
}
我已经尝试过不同的东西像vertical-align: bottom
的股利和display: inline-block
的按钮,但没有工作了我。
这是我的代码JSFiddle Demo。
这为我工作:http://jsfiddle.net/C7TZn/1/ – KFO