Three Column Layout side columns elastic middle fixed

后端 未结 2 2064
一生所求
一生所求 2021-01-29 06:16

I was wondering if anyone knows how to have a fixed width of the centered div and have the right and left div elastic on either side of the centered div. The centered div has a

2条回答
  •  无人共我
    2021-01-29 07:18

    Try to add the code what you tried when you post a question.

    HTML

    I am fluid
    I'm Fixed!
    I am fluid

    CSS

    html, body {
        height: 100%;
        font-family: 'Arial', 'Helvetica', Sans-Serif;
    }
    .container {
        display: table;
        width: 100%;
        height: 100%;
    }
    .container > div {
        display: table-cell;
        text-align: center;
    }
    .fixed {
        min-width: 200px; max-width:300px;
        background: rgb(34, 177, 77);
        color: white;
    }
    .fluid {
        background: rgb(0, 162, 232);
    }
    ​
    

    DEMO LINK

提交回复
热议问题