div的内容图片垂直居中代码(兼容多浏览器)
2013-09-05 13:28
459 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
<title>无标题文档</title>
<style type="text/css">
.psdthumb { height: 1%; overflow: hidden; display:table; border-spacing:10px; }
.psdthumb li {border:1px solid #aaa; width:240px; height:160px; text-align:center; vertical-align:middle; position:relative; margin: 10px; *float:left; display: table-cell; }
.psdthumb .qq { *position:absolute; top:50%; }
.psdthumb .qq img { *position:relative; top:-50%; left:-50%; }
</style>
</head>
<body>
<div class="psdthumb">
<li><div class="qq"><img src="http://mat1.qq.com/www/images/allskin/wmlogo.gif" ></div></li>
<li><div class="qq"><img src="http://img1.cache.netease.com/cnews/netease/logo_w.gif" ></div></li>
</div>
<p>查找更多代码,请访问:<a href="http://www.lanrentuku.com" target="_blank">XXX</a></p>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
<title>无标题文档</title>
<style type="text/css">
.psdthumb { height: 1%; overflow: hidden; display:table; border-spacing:10px; }
.psdthumb li {border:1px solid #aaa; width:240px; height:160px; text-align:center; vertical-align:middle; position:relative; margin: 10px; *float:left; display: table-cell; }
.psdthumb .qq { *position:absolute; top:50%; }
.psdthumb .qq img { *position:relative; top:-50%; left:-50%; }
</style>
</head>
<body>
<div class="psdthumb">
<li><div class="qq"><img src="http://mat1.qq.com/www/images/allskin/wmlogo.gif" ></div></li>
<li><div class="qq"><img src="http://img1.cache.netease.com/cnews/netease/logo_w.gif" ></div></li>
</div>
<p>查找更多代码,请访问:<a href="http://www.lanrentuku.com" target="_blank">XXX</a></p>
</body>
</html>
相关文章推荐
- div的内容图片垂直居中代码(兼容多浏览器)
- div的内容图片垂直居中代码(兼容多浏览器)
- a标签内容在div中垂直居中,不兼容低版本浏览器
- 纯css实现DIV以及图片水平垂直居中兼容多种浏览器(实现过程)
- 一段DIV内容垂直的代码,兼容各种浏览器
- 一段DIV内容垂直的代码,兼容各种浏览器
- div图片水平垂直居中不随滚动条滚动的CSS代码(兼容IE8+)
- div中的内容-图片img垂直居中的五种方法
- 兼容浏览器的图片垂直居中(复制别人的)
- 纯js实现Div在页面垂直居中!可根据浏览器大小的改变而改变!兼容各种浏览器----神器版!
- 真正的最短代码实现图片自适应div并且垂直居中(php实现无js)
- 未知高度定宽div水平居中及垂直居中(兼容ie6及其他牛逼浏览器)
- 关于DIV重叠定位和图片垂直居中问题的研究(兼容FF、IE6、7、8)
- 浏览器兼容CSS代码:按钮文字垂直居中(input button text vertical align)
- 浏览器兼容CSS代码:按钮文字垂直居中(input button text vertical align)
- DIV水平垂直居中 兼容多种浏览器
- 浏览器兼容CSS代码:按钮文字垂直居中(input button text vertical align)
- 纯css完美地解决图片在div内垂直水平居中,兼容IE7.0、IE6.0、IE5.5、IE5.0、FF、
- 浏览器兼容CSS代码:按钮文字垂直居中(input button text vertical align)
- 兼容各种浏览器的图片垂直居中CSS解决方案