flex:1将页面铺满

代码示范:

 

<!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>练习</title>
</head>
<body>
    <div id="main">
            <div id="aside">
                  hello 
            </div>
            <div id="content">
                   world
            </div>
        </div>
</body>
<script>
    
</script>
<style>
    #main  {
        display:flex;
    }
    #aside {
       width:300px;
       height:800px;
       background-color:aquamarine;
    }
    #content {
        height:800px;
        background-color: brown;
        flex:1;
        
       
    }
    body {
        margin:0;
    }
</style>
</html>

  

效果:

 

 

posted @ 2018-06-16 21:24  1点  阅读(704)  评论(0编辑  收藏  举报