align div in the bottom of another div using css

前端 未结 3 1586
别那么骄傲
别那么骄傲 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 00:48

    Click in this link, maybe it can help you

    #b {
    display: -webkit-inline-flex;
    display: -moz-inline-flex;
    display: inline-flex;
    
    -webkit-flex-flow: row nowrap;
    -moz-flex-flow: row nowrap;
    flex-flow: row nowrap;
    
    -webkit-align-items: flex-end;
    -moz-align-items: flex-end;
    align-items: flex-end;}
    

    http://jsfiddle.net/rudiedirkx/7FGKN/

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2021-02-06 01:06

    It will take div#c out of the flow of the document. It may not be perfect, but you can do something like the following:

    #b {
      position: relative;
    }
    
    #c {
      position: absolute;
      bottom: 0;
    }
    
    0 讨论(0)
提交回复
热议问题