单行图文混排垂直居中

 
<!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=utf-8" />
    <title>单行图文混排垂直居中</title>
    <style type="text/css">
        * {
            margin0px;
            padding0px;
        }
        body {
            font12px "宋体";
        }
        .cont {
            margin30px auto;
            padding75px 0px;
            width300px;
            height150px;
            border1px solid #000;
        }
            .cont img {
                vertical-alignmiddle;
            }
    </style>
</head>
<body>
    <div class="cont">
        <img src="" width="150" height="150" />向我看齐
    </div>
</body>
</html>

你可能感兴趣的:(单行图文混排垂直居中)