What's the Proper way to achieve 3-Column layout with fluid center

后端 未结 3 1586
独厮守ぢ
独厮守ぢ 2021-02-20 04:58

I am working on a 3-column layout with two fixed-width sidebars (left and right) and a fluid center. I have followed A List Apart\'s Holy Grail article, and, although this works

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-20 05:34

    I believe this should be useful in most cases.

    Please see link below.

    http://jsfiddle.net/ykAPM/278/

    #left {
    position:fixed;
    left:0;
    width:50px;
    height:100%;
    background-color:pink;
    }
    
    #center {
    margin: 0 50px;
    background-color:green;
    overflow:auto
    }
    
    #right {
    position:fixed;
    right:0;
    top:0;
    width:50px;
    height:100%;
    background-color:red;
    }
    
    body, html, #wrapper {
    width:100%;
    height:100%;
    padding:0;
    margin:0;
    }
    
    #test{
    height:1000px;
    }
    

提交回复
热议问题