-1
像我有以下代碼:CSS - 垂直對齊內格
<h1>4 Channel DVR - High Res 960H WD1, (500GB HDD)</h1>
<div class="col-50 product-wrapper left">
<img class="product-image" src="http://176.67.174.179/ukcctvinstallations.co.uk/wp-content/uploads/2014/09/4-channel-dvr.jpg" alt="4-channel-dvr" width="522" height="283" class="alignnone size-full wp-image-398" />
</div>
<div class="col-50-end left"
Description goes here Description goes here Description goes here Description goes here Description goes here Description goes here Description goes here Description goes here Description goes here Description goes here Description goes here Description goes here Description goes here Description goes here
</div>
<div class="clear"></div>
CSS:
.col-50 {
width: 49%;
margin-right: 2%;
}
.col-50-end {
width: 49%;
}
.product-wrapper {
/*empty*/
}
.product-image {
/*empty*/
}
我所想要做的是垂直對齊的圖像中的同事中間50格。描述將全部是不同的長度,因此高度每次都會改變,所以對齊將不得不垂直居中。
有沒有一個跨瀏覽器的方式,我可以做到這一點?
感謝您的解決方案@Ian - 我其實是複製的代碼,但不能讓它按你的演示工作; http://176.67.174.179/ukcctvinstallations.co.uk/product/1-camera-residential-system-hi-res/ - 底部產品是演示的副本 – nsilva 2014-09-28 22:30:49
從列中刪除'left'類。浮點數正在破壞'table-cell'屬性。無論如何它不再需要。 – Ian 2014-09-28 22:44:02
完美,謝謝! – nsilva 2014-09-28 22:45:45