让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">aasdasap>
    <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>

你可能感兴趣的:(让div里面标签居中的方法)