Keep div at the bottom of another div - css

前端 未结 5 1135
借酒劲吻你
借酒劲吻你 2020-12-24 06:56
© 1965 - 2010

I want the #copyright to be at the bottom of #outer

Here is the css for #copyright

5条回答
  •  旧时难觅i
    2020-12-24 07:28

    #copyright {
        position: absolute;
        bottom: 0;
    }
    #outer {
        position: relative;
    }
    

    This will have the unfortunate side effect though that #copyright does not count towards the height of #outer anymore, in your example #outer would be 0px high. You can add a bottom-padding to #outer if you're working with fixed heights.

    #copyright {
        position: absolute;
        bottom: 0;
        height: 200px;
    }
    #outer {
        position: relative;
        padding-bottom: 200px;
    }
    

提交回复
热议问题