Keep div at the bottom of another div - css

前端 未结 5 1137
借酒劲吻你
借酒劲吻你 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条回答
  •  甜味超标
    2020-12-24 07:16

    1. define height of #outer
    2. set #outer to position:relative;
    3. set #copyright to position:absolute; bottom: 0; left: 0;
        #outer {
          height: 100px;
          border: 1px solid red;
          position: relative;
        }
    
        #copyright {
          position:absolute; 
          height: 30px; 
          bottom: 0; 
          left: 0;
          border: 1px solid black;
          width: 300px;
        }   
    
        

    Also, never use "0px". There is no such thing as zero pixels, only zero. Correct way is "right: 0;"

提交回复
热议问题