webVueBlog / WebGuideInterview

「WebGuideInterview学习」每日 3+1,以面试题来驱动学习,提倡每日学习与思考,每天进步一点!每天早上纯手工发布(死磕自己,愉悦大家)准备 前端 面试,首选 WebGuideInterview!面试题大收集,面试集锦 ❤ 💝 💘

Home Page:https://webvueblog.github.io/WebGuideInterview/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

左边固定右边自适应

webVueBlog opened this issue · comments

   .box {
            height: 500px;
            display: flex;
        }
        .box div {
            height: 300px;
            text-align: center;
        }
        .box div.right {
            flex: 1;//右边自适应
            border: 1px solid #000000;
        }
        .box div.left {
            border: 1px solid #000000;
            flex-basis: 100px;//左边固定,优先级最高
        }
    //html
    <div class="box">
        <div class="left">左边固定效果</div>
        <div class="right">右边自适应效果</div>
    </div>