Two floated columns - one fixed, one loose width

前端 未结 8 1130
醉酒成梦
醉酒成梦 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:09

    Have a look at this. There aren't any demos, but I've used tutorials from this guy before so I assume it works fine. I gather from the article that the main content is liquid. The side content may also be liquid, but I think you can just give it a fixed width and leave it at that. The trick here is to place the main content first.

    0 讨论(0)
  • 2021-02-02 07:22

    There's actually an easier way to do it than using floats:

    .container {
        position: relative;
    }
    
    .left {
        width: 185px;
        position: absolute;
        top: 0;
        left: 0;
    }
    
    .right {
        margin-left: 185px;
    }
    
    0 讨论(0)
提交回复
热议问题