Float a div without defining height property

后端 未结 3 658
有刺的猬
有刺的猬 2021-01-18 20:44

It looks very simple (and maybe is, just got stucked) -> just for fun, no practical need right now.

I got this:

3条回答
  •  礼貌的吻别
    2021-01-18 21:37

    I think the best way is:

    .master {
        width: 100%;
        height: 100%;
        display: table;
    }
    .left {
        width:10%;
        height: 100%;
        float: left;
        background: red;
        display: table;
    }
    .right {
        width: 89%;
        margin-left: 1%;
        float: left;
        background: blue;
        color: #FFF;
        display: table;
    }
    

提交回复
热议问题