flex固定底部栏

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Title</title>
    <style>

        .box { display: flex; min-height: 100vh; flex-direction: column; }
        .box-con { flex: 1; }
        header{
            height:100px;
            background:red;
        }
        footer {
            height:100px;
            background:cyan;
        }
    </style>
</head>
<body class="box">
    <header></header>
    <main class="box-con"></main>
    <footer></footer>
</body>
</html>

 

posted @ 2017-01-17 14:27  webbky  阅读(2692)  评论(0编辑  收藏  举报