I've finally gotten around to trying flexbox for my new design, since it could finally solve the age old question, how do you vertically center a bunch of text on the screen... only to find, it's not as easy as I thought.
If the content is higher than the container, then the top part of the content will actually be hidden and not be accessible by scrolling. The behaviour is the same for both Chrome and Firefox. I created a Codepen demo reproducing the issue: http://codepen.io/perrin4869/pen/LGKOwy
The demo contains 3 different methods for vertically centering content. Both the transform: translateX(-50%)
and display: flex
methods behave exactly the same, the table method works almost how I'd expect it to work, with the disadvantages that come from actually using display: table
.
Edit:
The question is, is there a way to have the overflow of a flexbox
behave like the overflow in the display: table
example?