您的位置:首页 > Web前端 > CSS

css div img 垂直居中对齐!

2015-07-02 00:00 543 查看
<style>
.picbiglist{ width:232px; float:left;}
.piclist{width:229px;height:220px;margin:10px;;border:1px solid #dcdcdc;text-align: center; float:left; border-radius: 4px; padding:2px;}
.piclist img{vertical-align:middle;max-height: 218px;max-width: 218px; }
.piclist span{ height:100%; width:0; overflow:hidden; display:inline-block; vertical-align:middle; }
.p_c{ width:232px; float:left; text-align:center;}
</style>

<pre name="code" class="html"> <div class="picbiglist">
<div class="piclist" style="width:218px;height:220px;margin:0 auto;text-align: center;"><a href="/" target="_blank" title="/"><img src="./uploads/{qf:$honorlist[foo].img}" alt="{qf:$honorlist[foo].title}" / style="vertical-align:middle;max-width: 214px; max-height:170px;display: !important;"></a>
<span style="height:100%; width:0; overflow:hidden; display:inline-block; vertical-align:middle;"></span> </div>
<br />
<div class="p_c"><a href="./uploads/{qf:$honorlist[foo].img}" target="_blank">{qf:$honorlist[foo].title}</a></div>
</div>
{qf:/section}




版权声明:本文为博主原创文章,未经博主允许不得转载。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  css