Scrolling with fixed div layout and min-widths

前端 未结 7 1508
情歌与酒
情歌与酒 2021-01-04 19:03

\"Desired

I\'ve been trying to layout this page, but for the life of me, can\'t seem to get it to wor

7条回答
  •  误落风尘
    2021-01-04 19:27

    Pure CSS Solution. Here's my updated answer. Please check.

    Demo link below:

    Fiddle

    HTML

    Title Bar
    Contents

    CSS

    html, body {
        margin:0;
        padding:0;
        height:100%;
    }
    #title-bar, #content {
        min-width:1024px;
        width:100%;
    }
     #title-bar {
        position:fixed;
        top:0;
        background:#CC0000;
        height:50px;
        color:#fff;
    }
    #content {
        top:50px;
        position:relative;
        background:#9EC2E3;
        height:calc(100% - 50px);
        overflow:auto;
    }
    

    Just let me know if you have concerns.

提交回复
热议问题