align div in the bottom of another div using css

前端 未结 3 1578
别那么骄傲
别那么骄傲 2021-02-06 00:09

I want to align the DIV c in the bottom of the DIV b not DIV a

3条回答
  •  [愿得一人]
    2021-02-06 01:00

    This should work:

    #b {
      position: relative;
    }
    
    #c {
      position: absolute;
      bottom: 0px;
    }
    

    The trick is position: relative; on the parent element. Without that, #c will float away to the bottom of the page.

提交回复
热议问题