让div里面标签居中的方法

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title></title>
</head>
<body>
<div class="box">
    <p style="display: inline-block">aasdasa</p>
    <img src="http://pics.taobao.com/bao/album/promotion/taoscars_180x95_071112_sr.jpg" style="width: 50px;height: 20px" />

</div>
</body>

<style type="text/css">
    .box {
        display: table-cell;
        vertical-align:middle;
        width:200px;
        height:200px;
        text-align:center;
        border: 1px solid #eee;
    }
    .box img {
        vertical-align:middle;
    }
</style>
</html>
展开阅读全文

没有更多推荐了,返回首页