Scrolling only content div, others should be fixed

后端 未结 7 1333
广开言路
广开言路 2020-12-17 08:15

I have three divs. I need header and left_side divs to be fixed and content div to scroll. I\'ve been searching for solution and found something with overflow and <

7条回答
  •  悲&欢浪女
    2020-12-17 09:09

    overflow: auto; adds the scroll when need

    #header{
        width: 100%;
        height: 139px;
        background-image: url('images/Header_grey.gif');   
        overflow: hidden;  //code added to prevent scroll
    }
    
    
    #left_side{
        width: 210px;
        height: 700px;
        background-image: url('images/Left_side.gif');
        background-repeat:repeat-y;
        overflow:hidden;  //code added to prevent scroll
        position:absolute;
        font-size: 16px;
    }
    #content{
         height: auto;
         padding: 20px;
         margin-left: 230px;
         margin-right: 20px;
        padding-bottom: 30px;
        overflow: auto;  //code added
     }
    

提交回复
热议问题