图片水平垂直居中的CSS解决方案!
html:
<ul>
<li>
<div><a href=”#” target=”_blank”><img src=”images/brand/product/1.png” width=”142″ height=”158″ alt=”产品名称一”></a></div>
<span><a href=”#” target=”_blank”>海星鱼缸水族箱 AEC 单拱面 拱面鱼缸</a></span>
<span>免换水 全国包邮 生态鱼缸</span>
<div><a href=”#” target=”_blank”>查看详情</a></div>
</li>
<li>
<div><a href=”#” target=”_blank”><img src=”images/brand/product/2.png” width=”167″ height=”161″ alt=”产品名称二”></a></div>
<span><a href=”#” target=”_blank”>海星鱼缸水族箱 AEC 单拱面 拱面鱼缸</a></span>
<span>免换水 全国包邮 生态鱼缸</span>
<div><a href=”#” target=”_blank”>查看详情</a></div>
</li>
<li>
<div><a href=”#” target=”_blank”><img src=”images/brand/product/3.png” width=”139″ height=”161″ alt=”产品名称三”></a></div>
<span><a href=”#” target=”_blank”>海星鱼缸水族箱 AEC 单拱面 拱面鱼缸</a></span>
<span>免换水 全国包邮 生态鱼缸</span>
<div><a href=”#” target=”_blank”>查看详情</a></div>
</li>
<li>
<div><a href=”#” target=”_blank”><img src=”images/brand/product/4.png” width=”138″ height=”161″ alt=”产品名称四”></a></div>
<span><a href=”#” target=”_blank”>海星鱼缸水族箱 AEC 单拱面 拱面鱼缸</a></span>
<span>免换水 全国包邮 生态鱼缸</span>
<div><a href=”#” target=”_blank”>查看详情</a></div>
</li>
</ul>
css:
.brand_list .pro_list {
float: left;
width: 984px;
overflow: hidden;
}
.pro_list li {
display: block;
float: left;
height: 300px;
width: 210px;
margin-right: 16px;
overflow: hidden;
padding: 0 10px;
text-align: center;
}
.pro_list .thumb {
height: 200px;
width: 200px;
overflow: hidden;
position: relative;
display: table-cell;
text-align: center;
vertical-align: middle;
padding: 5px;
}
.pro_list .thumb a {
display: block;
position: static;
*position: absolute;
top: 50%;
}
.pro_list .thumb img {
position: static;
*position: relative;
top: -50%;
left: -50%;
}
css:在IE6的垂直居中有一点小的问题,就是并未绝对的垂直居中,只是近似罢了,但是在其它浏览器中却是没有问题的哈。
Hey very nice website!! Guy .. Excellent .. Wonderful .. I will bookmark your site and take the feeds alsoI am|I’m} glad to seek out so many useful info right here in the submit, we’d like work out more techniques in this regard, thank you for sharing. . . . . .
Thanks for sharing excellent informations. Your web-site is very cool. I am impressed by the details that you have on this blog. It reveals how nicely you perceive this subject. Bookmarked this website page, will come back for more articles. You, my pal, ROCK! I found just the information I already searched all over the place and simply could not come across. What a great site.