Bootstrap 4: Footer not at bottom

前端 未结 3 1319
梦谈多话
梦谈多话 2020-12-09 19:30

I know this question was probably asked some hundred times, but sadly no answer that I found in here really helped me.

I tried these answers for example:

3条回答
  •  渐次进展
    2020-12-09 20:20

    You can use built-in bootstrap class to achieve this.

    What you need is the container to be a column flex container . class to use are : d-flex flex-column

    To set the container to height:100% you can apply the class h-100to html, body and the container or add to the container style height:100vh;

    For the footer, a margin-top:auto will do, the class to use is : mt-auto;

    example below to run in full page mode

    
    
    
    
    
    
        
            
            

    Login

    Login Now!

    codepen updated https://codepen.io/anon/pen/PBpgNN


    reminder for boostrap classes https://getbootstrap.com/docs/4.5/utilities/flex/ about sizing see https://getbootstrap.com/docs/4.5/utilities/sizing/

提交回复
热议问题