A good trick for centering using pseudo-elements of the parent:
(assuming #element is what you want to center in its parent and #parent its parent)
A few remarks:
– Don’t forget to put html and body height to 100% if you don’t have enough content to cover the window.
– It only works on browsers that support pseudo-elements (any modern browser)