Liquid layout with liquid left + fixed right column

前端 未结 5 784
失恋的感觉
失恋的感觉 2020-12-20 03:34

The question is pretty self explanatory. All these div elements are 100% in height I need the left div to flex, but not have it set to overflow:hidden so that I can make it\

5条回答
  •  [愿得一人]
    2020-12-20 04:15

    use table-cell for your purpose :)

    EDIT after Hashem Qolami answer, since you have tagged question in css3 category, let me be clear that display:table is supported IE8 and onwards....and is useful if you don't wanna mess around with clearing the divs!!

    fiddle here

     html, body {
        width:100%;
        height:100%;
        margin:0;
        padding:0;
    }
    #parent {
        display:table;
        width:100%;
        height:100%;
        word-break:break-all;
    }
    #left {
        display:table-cell;
        border:1px solid red;
    }
    #right {
        width:450px;
        display:table-cell;
        border:1px solid green;
    }
    

提交回复
热议问题