python(html 居中、页面百分百布局)

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        body{
            margin: 0;
        }
        .left{
            float: left;
        }
        .right{
            float: right;
        }
        .pg-header{
            height: 48px;
            background-color: #545454;
            color: darkblue;
        }
        .pg-content .menu{
            width: 20%;
            background-color: red;
            min-width: 200px;
            /*最小width:200px时,20%的固定就不会生效*/
        }
        .pg-content .content{
            width: 80%;
            background-color: #2459a2;
        }
    </style>
</head>
<body>
    <div class="pg-header">
            <div style="width: 100px;margin: 0 auto">
                自动居中
            </div>
    </div>
    <div class="pg-content">
        <div class="menu left">a</div>
        <div class="content left">a</div>
    </div>
    <div class="pg-footer"></div>
</body>
</html>

说点什么

avatar
  Subscribe  
提醒