【css】多行文字图片混排容器内垂直居中解决方案

it2022-05-05  124

css:   .box-wrap{display:table;width:200px;height:200px;*position:relative;}/*最外边的容器,需固定宽高*/ .box-hack{display:table-cell;height:200px;vertical-align:middle;*position:absolute;*top:50%;}/*需要定义高度*/ .box-ctn{*position:relative;*top:-50%;}   html:   <div class="box-wrap"> <div class="box-hack"> <div class="box-ctn"> <img alt="图片" src="http://www.baidu.com/img/shouye_b5486898c692066bd2cbaeda86d74448.gif"> <p>这是文字这是文字这是文字</p> </div> </div> </div>   demo地址: http://jsfiddle.net/WdNL7/1/   原文出自: http://note.youdao.com/share/?id=91293504345e960c53103935d5645c7c&type=note

转载于:https://www.cnblogs.com/zzuIvy/p/cssChuiZhiJuZhong.html

相关资源:各显卡算力对照表!

最新回复(0)