How to align content of a div to the bottom

后端 未结 26 2533
挽巷
挽巷 2020-11-22 01:13

Say I have the following CSS and HTML code:

26条回答
  •  遇见更好的自我
    2020-11-22 01:57

    if you could set the height of the wrapping div of the content (#header-content as shown in other's reply), instead of the entire #header, maybe you can also try this approach:

    HTML

    
    

    CSS

    #header-content{
        height:100px;
    }
    
    #header-content::before{
      display:inline-block;
      content:'';
      height:100%;
      vertical-align:bottom;
    }
    
    #header-content span{
        display:inline-block;
    }
    

    show on codepen

提交回复
热议问题