Internet Explorer doesn't honor my min-height: 100% with flexbox

前端 未结 6 1714
借酒劲吻你
借酒劲吻你 2021-02-01 21:20

I\'ve been looking through all the min-height: 100% solutions on StackOverflow and the web and I can\'t seem to find one that fits my (relatively simple) needs.

Here\'s

6条回答
  •  悲哀的现实
    2021-02-01 21:27

    Here is the fix:

    HTML

    
      
    Header
    Here comes the content ...
    Footer

    CSS

    body {
      display: flex;
      flex-direction: column;
      height: 100vh;
    }
    header, footer {
      flex-shrink: 0;
    }
    main {
      flex: 1 0 auto;
    }
    

    jsfiddle: http://jsfiddle.net/d5syw3dc/

提交回复
热议问题