首页 > 代码库 > flex_宽度补全

flex_宽度补全

宽度40px,另一个的补全宽度:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        html,body,.box{
            height:100%;
        }
        body{
            margin:0;

        }
        .box{
            display:-webkit-flex;
            -webkit-flex-direction: row;
            display:flex;
            flex-direction:row;
        }
        .box .child{
            width:40px;
            background:#f00;
        }
        .box .child1{
            flex:1;
            background:#0f0
        }
    </style>
</head>
<body>
<div class="box">
    <div class="child">child</div>
    <div class="child1">child1</div>
</div>
</body>
</html>

 

flex_宽度补全