其他分享
首页 > 其他分享> > 弹性布局之定宽剩下填满

弹性布局之定宽剩下填满

作者:互联网

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <style type="text/css">
            #container{
                display: flex;
                width: 500px;
                border: 1px solid red;
            }
            #box1{
                background-color: mediumspringgreen;
                width: 100px;
                flex-grow: 0;
            }
            #box2{
                background-color: greenyellow;
                flex-grow: 1;
            }
        </style>
    </head>
    <body>
        <div id="container">
            <div id="box1">
                定宽
            </div>
            <div id="box2">
                填满
            </div>
        </div>
    </body>
</html>

 

标签:flex,填满,color,弹性,width,background,之定,grow
来源: https://www.cnblogs.com/223zzm/p/11279026.html