码迷,mamicode.com
首页 > 其他好文 > 详细

flex:1将页面铺满

时间:2018-06-16 22:37:39      阅读:408      评论:0      收藏:0      [点我收藏+]

标签:margin   scale   oct   width   doctype   isp   play   效果   rip   

技术分享图片

代码示范:

 

<!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>

  

效果:

 技术分享图片

 

flex:1将页面铺满

标签:margin   scale   oct   width   doctype   isp   play   效果   rip   

原文地址:https://www.cnblogs.com/guangzhou11/p/9191464.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!