How to create a 3 columns fluid fixed fluid layout?

后端 未结 3 1831
名媛妹妹
名媛妹妹 2020-12-16 04:41

I\'m looking for a 3 column css layout, with 1 fixed section at the middle and 2 fluid sidebar around it:

http://www.uploadup.com/di-UEFI.png

middle has 250p

3条回答
  •  粉色の甜心
    2020-12-16 04:43

    To make this work in IE6/7 without JavaScript, the easiest way to do this is with a table.

    I know, I know. It's not that bad in this case, all considered.

    See: http://jsfiddle.net/thirtydot/Q2Qxz/

    Tested in IE6/7 + Chrome, and it will just work in all other modern browsers.

    HTML:

    fluid fixed

    CSS:

    html, body {
        margin: 0;
        padding: 0;
        border: 0
    }
    #container {
        border: 0;
        table-layout: fixed;
        width: 100%
    }
    #container td {
        vertical-align: top
    }
    #mid {
        width: 250px;
        background: #ccc
    }
    #left {
        background: #f0f
    }
    #right {
        background: #f0f
    }
    

提交回复
热议问题