Room display:table; inside .outer-wrapper seemed to work ...
JSFiddle link
EDIT: two wrappers using a display table cell
I would comment on your answer, but I have too little reputation :( anyway ...
Disable your answer , it seems that all you have to do is add display:table; inside .outer-wrapper (Dejavu?) and you can get rid of table-wrapper wholeheartedly.
Jsfiddle
But yes, position:absolute allows you to put a div on top of img , I read too fast and thought you couldn't use position:absolute , but it looks like you already understood that. Props!
I will not publish the source code since all its 99% timbres work, so please refer to its answer or just use the jsfiddle link
Update: One Converter Using Flexbox
It was time, and all the cool kids use flexbox:
<div style="display: flex; flex-direction: column; justify-content: center; align-items: center;"> stuff to be centered </div>
Complete JSFiddle Solution
Browser support ( source ): IE 11+, FireFox 42+, Chrome 46+, Safari 8+, iOS 8.4+ ( -webkit- ), Android 4.1+ ( -webkit- prefix)
CSS Tricks: Flexbox Guide
How to create a center in CSS : enter how you want your content to be centered, and it displays how to do it in html and css. The future is here!
woojoo666 Jul 19 '13 at 1:38 2013-07-19 01:38
source share