美文网首页
使用flex布局实现满屏品字布局

使用flex布局实现满屏品字布局

作者: 桜抄 | 来源:发表于2019-08-19 09:18 被阅读0次

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <title>Document</title>

</head>

<style>

    div{

        background:red;

        border:1px solid white

    }

    #up{

        position:absolute;

        top:0%;

        width: 100vw;

        height: 50vh;

        background:pink;

    }

    #bottom{

        position:absolute;

        bottom: 0%;

        width: 100vw;

        height: 50vh;

        display: flex;

    }

    #bottom #left{

        flex: 1;

        background:yellow;

    }

    #bottom #right{

        flex: 1;

        background:orange;

    }

</style>

<body>

    <div id="up">

    </div>

    <div id="bottom">

        <div id="left"></div>

        <div id="right"></div>

    </div>

</body>

</html>

相关文章

网友评论

      本文标题:使用flex布局实现满屏品字布局

      本文链接:https://www.haomeiwen.com/subject/gxijsctx.html