-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