html css 如何让div 中的<p>的内容竖向居中(<p>中含有多行内容)

html css 如何让div 中的

的内容竖向居中(

中含有多行内容,不能使用line-height),

用table做容器,td valign="middle"

text-align:center

xxx

块级元素垂直居中,可以用position实现,给父级一个相对定位,position:relative;给需要垂直居中的子级绝对定位
position:absolute;top:0px;bottom:0px;margin:auto 0;就能实现垂直居中。这种方法在ie8以下的版本不支持。另外,自级要有高度。跟margin:0 auto的前提类似