使用CSS垂直排列嵌套的DIV [英] Vertically align nested DIVs using CSS
问题描述
请看
http:// jsfiddle .net / user0815 / ZU9bT /
我希望包含图像的两个DIV应该在外部DIV中垂直对齐。 b
$ b
我尝试使用常见的技巧:
display:table-cell
vertical -align:center
但是没有爱。
任何想法?
它应该是 vertical-align:middle
and not vertical-align:center
。
检查演示: http://jsfiddle.net/ZU9bT/2/
更新后的演示替换为 display:inline-block
of float:left
: http://jsfiddle.net/ ZU9bT / 3 /
Look at at
http://jsfiddle.net/user0815/ZU9bT/
I want that the two DIV containing an image each should be vertically aligned within the outer DIV.
I tried the common tricks using
display: table-cell
vertical-align: center
but no love.
Any idea?
It should be vertical-align: middle
and not vertical-align: center
.
Check this demo: http://jsfiddle.net/ZU9bT/2/
Updated demo with display: inline-block
instead of float: left
: http://jsfiddle.net/ZU9bT/3/
这篇关于使用CSS垂直排列嵌套的DIV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!