web三件套(经验贴)让文字居于DIV的中间

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>拍拍网</title>
    <style type="text/css">
        #center{
     
     
            width: 100%;
            height: 60px;
            background: #99ccff;
            margin:20px auto;
            text-align: center;
            display: block;
        }
        strong{
     
     line-height: 60px}/*设置行高和div的高度一致使得文字居于div中间*/
    </style>
</head>
<body>
<div id="center">
    <strong>拍拍网网站运维中心 版权所有
    copyright &copy; 2012-2015,  all rights reserved.</strong>
</div>

</body>
</html>

效果:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_44861675/article/details/108276247