I'm applying min-height: 100vh;
to a flexbox container and I get a vertical scrollbar when I use justify-content: space-around;
I don't want to force the height, but I don't understand why the scrollbar is there since the contents have smaller dimensions than the viewport.
Adding flex-grow seems to do the trick:
body {
min-height: 100vh;
display: flex;
flex-direction: column;
}
.wrapper {
display: flex;
flex-direction: column;
flex-grow: 1;
justify-content: space-around;
}
https://jsfiddle.net/uxgaaccr/2/
Not sure why, but height: 100%
on .wrapper
doesn't seem to suffice, it needs flex-grow
instead. I think there was some extra white-space coming from justify-content: space-around
that was adding to the height. Not confident in my reasoning, but it seems to work...