1. 主页
  2. 文档
  3. 移动基础
  4. 写布局案例

写布局案例

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <style>
        * {
            box-sizing: border-box;
            padding: 0;
            margin: 0;
        }
        
        html {
            height: 100%;
        }
        
        body {
            display: flex;
            min-width: 100%;
            background-color: #e2e2e2;
            color: #595B66;
            flex-direction: column;
            min-height: 100%;
        }
        
        a {
            font-size: 12px;
            color: #686868;
            text-decoration: none;
        }
        
        li {
            list-style: none;
        }
        
        .header {
            width: 100%;
            height: 50px;
            background-color: black;
            color: #e2e2e2;
        }
        
        .main {
            flex: 1;
            display: flex;
        }
        
        .left {
            width: 150px;
            background-color: aquamarine;
        }
        
        .right {
            flex: 1;
            background-color: #686868;
        }
        
        .foot {
            width: 100%;
            height: 50px;
            background-color: black;
            color: cornsilk;
        }
        
        .foot .ful {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100%;
        }
        
        .foot .ful .fli {
            flex: 1;
            display: flex;
            height: 100%;
            align-items: center;
            justify-content: center;
        }
        
        .foot .ful .fli .fa {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
        }
    </style>

    <div class="header">header</div>


    <div class="main">
        <div class="left">left</div>
        <div class="right">right</div>
    </div>

    <div class="foot">
        <ul class="ful">
            <li class="fli">
                <a href="#" class="fa">
                    <i></i>
                    <span>首页</span>
                </a>
            </li>
            <li class="fli">
                <a href="#" class="fa">
                    <i></i>
                    <span>分类</span>
                </a>
            </li>
            <li class="fli">
                <a href="#" class="fa">
                    <i></i>
                    <span>购物车</span>
                </a>
            </li>
            <li class="fli">
                <a href="#" class="fa">
                    <i></i>
                    <span>个人中心</span>
                </a>
            </li>
        </ul>
    </div>

</body>

</html>
这篇文章对您有用吗?

我们要如何帮助您?