How to make a sticky footer using flexbox in IE11?

后端 未结 5 1511
春和景丽
春和景丽 2020-11-29 08:56

I\'m trying to make a simple design with flexbox but I\'m having trouble with IE11. Basically, I want a footer that sticks to the bottom only if the content is not high enou

5条回答
  •  南方客
    南方客 (楼主)
    2020-11-29 09:13

    A solution that really helped me (may not be applicable in all cases) is adding an arbitrary fixed height in pixels - the min-height overrides the fixed height so there's no cropped content. Here's a CSS example:

    .fullheight {
        min-height: 100vh;
        height: 200px; /*IE 11 flexbox min-height fix*/
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        align-content: center;
    }
    

提交回复
热议问题