Two floated columns - one fixed, one loose width

前端 未结 8 1280
醉酒成梦
醉酒成梦 2021-02-02 06:34

I\'ve looked around SO, but I cannot find one that matches my occurrence, I basically have two columns one fixed width (185px) and the other column has no fixed wid

8条回答
  •  孤城傲影
    2021-02-02 07:07

    By using negative margins from this tutorial the CSS can look as follows

    html, body, .container {
        height:100%;
        padding:0;
        margin:0;
    }
    .container {
        min-width: 300px;
    }
    .left {
        float:left;
        width: 185px;
        margin-right: -185px;
        height:100%;
    }
    .right {
        margin-left:185px;
    }
    

    http://jsfiddle.net/Y5FAT/1/

    http://jsfiddle.net/Y5FAT/

提交回复
热议问题