Sidebar height stretch with the content height CSS

前端 未结 4 1163
忘了有多久
忘了有多久 2020-12-22 12:29

I have 2 DIVs:

How would i make the sidebar div stretch the s

4条回答
  •  眼角桃花
    2020-12-22 12:53

    Set the same height for them, you could possibly even give them a float. By the way you have a bug in your html, write it like so:

    
    

    And the css:

    #sidebar{
    width: 40px;
    height:350px;
    float: left;
    margin-left: 10px;
    border: 1px solid red;
    }
    
    #content{
    width: 165px;
    height:350px;
    float: left;
    margin-left: 10px;
    border: 1px solid blue;
    }
    

    ​ Example

提交回复
热议问题