How to make a sticky footer using flexbox in IE11?

后端 未结 5 1508
春和景丽
春和景丽 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:21

    Since this might be a desired solution: if you don't necessarily want grow the main tag but still align the footer at the bottom:

    html, body {
      margin: 0;
      display: flex;
    }
    html {
      height: 100%;
    }
    body {
      flex-flow: column nowrap;
      flex-grow: 1;
    }
    footer {
      margin-top: auto;
    }
    Header

    Main

    Main

    Main

    Main

    Main

    Footer

提交回复
热议问题