首页 > 其他 > 详细

两端固定,中间自动填满

时间:2021-05-23 15:08:23      阅读:19      评论:0      收藏: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>
    <style>
        body,
        html {
            height: 100%;
            color:white
        }

        #parent {
            height: 100px;
            background-color: #36e;
            display: flex;
            justify-content: space-between;
            flex-direction: row;
        }

        div.child1 {
            height: 100%;
            width: 50px;
            background-color: #111555;
        }

        div.child2 {
            flex: 1;
            background-color: #0f0;
            height: 100%;
        }

        div.child3 {
            height: 100%;
            width: 60px;
            background-color: red;
        }
    </style>
</head>

<body>
    <div id="parent">
        <div class="child1">左侧</div>
        <div class="child2">中间</div>
        <div class="child3">右侧</div>
    </div>
</body>

</html>

 

两端固定,中间自动填满

原文:https://www.cnblogs.com/spencermo/p/14800545.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!