Elements lose the status of a flexible element if they are absolutely positioned. To do what you offer, you need to completely place the flex container:
http://codepen.io/cimmanon/pen/prFdm
.foo { display: -webkit-box; display: -ms-flexbox; display: -webkit-flex; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -webkit-box-pack: center; -webkit-box-align: center; position: absolute; top: 0; bottom: 0; left: 0; right: 0; } .bar { margin: auto; } <div class="foo"> <div class="bar">Bar</div> </div>
Note that I omitted the moz 2009 Flexbox prefixes because absolute positioning breaks flex containers in Firefox. It should only work on versions of Firefox with standard Flexbox properties.
source share