Using flexbox sticky footer with bootstrap

前端 未结 4 685
一整个雨季
一整个雨季 2021-02-14 09:58

I\'m trying to use this sticky footer:

http://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/

body{
  display: flex;
  min-height: 100vh;
          


        
4条回答
  •  Happy的楠姐
    2021-02-14 10:40

    Bootstrap 4 now uses flexbox by default so it's easier to get a sticky (not fixed) footer w/o additional CSS for the flexbox. You just need to ensure the body has min-height...

    body {
      min-height: 100vh; 
    }
    

    Then use the flexbox utility classes...

    
      
      

    Bootstrap 4 Flexbox Sticky Footer

提交回复
热议问题