2

I have a flex css which everything works fine on firefox, but when I am using chrome, the main_content has the whole screen size, but the div inside it has just the height of the content

.sticky-footer-wrapper{
    min-height: 100%;
    display: -webkit-flex;
    display: flex;
    flex-direction: column;
}
.main_content{
  flex:1;
}
.main_footer{
  background: 3em;
  height: 3em;
}

This is the markup:

<div class="sticky-footer-wrapper">

<nav class="main_header">
</nav>

<main class="main_content" role="main"> 
    <div>content...</div>
</main>

<footer class="main_footer Footer">
</footer>

</div>

Here is a jsfiddle:

https://jsfiddle.net/9usvm1c1/1/

all the content should be yellow, but it is not

What am I doing wrong?

Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701
Victor Oliveira
  • 1,109
  • 1
  • 12
  • 29

2 Answers2

1

Min height is not compatible with percentage in chrome. Use pixels. Ex: min-height:600px;

Sayantan Das
  • 73
  • 1
  • 1
  • 16
1

have you tried using

align-content: stretch;

instead of min-height?

please post a working example/fiddle!

https://css-tricks.com/snippets/css/a-guide-to-flexbox/

Scott Murphy
  • 136
  • 5