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 >
            <div >
                  hello 
            </div>
            <div >
                   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>

  

效果:

 flex:1将页面铺满

 

相关文章:

  • 2021-11-03
  • 2022-12-23
  • 2021-12-29
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2021-06-29
  • 2022-02-05
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-04
  • 2022-12-23
  • 2021-04-01
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案