How can I position my div at the bottom of its container?

前端 未结 24 2449
广开言路
广开言路 2020-11-22 00:46

Given the following HTML:



        
24条回答
  •  悲哀的现实
    2020-11-22 01:22

    While none of the answers provided here seemed to apply or work in my particular case, I came across this article which provides this neat solution :

    #container {
      display: table;
    }
    
    #copyright {
      display: table-footer-group;
    }
    

    I find it very useful for applying responsive design for mobile display without having to reorder all the html code of a website, setting body itself as a table.

    Note that only the first table-footer-group or table-header-group will be rendered as such : if there are more than one, the others will be rendered as table-row-group.

提交回复
热议问题