So i am trying get 2 div-containers which both should contain centered text (Both x- and y-axis).
Thanks to Google and stackoverflow, i stumbled over a few workarounds w
Basically first you have to define the parent element as table from CSS and then you can display its child element as a table cell.
For example,
div.parent {
display: table;
}
div.parent div.child {
display: table-cell;
vertical-align: middle;
}
Check out this link, it would clarify your queries.. http://css-tricks.com/vertically-center-multi-lined-text/
Vertical-align:middle
property is not used with position:absolute;
if you are using vertical-align:middle then try this layout modified layout
http://jsfiddle.net/7Rgvs/5/
use display: table for the (holder #left-menu element) and display: table-cell for the inner holder element and use this styles:
#left-menu .inner {
display: table-cell;
margin: 0 auto;
text-align: center;
vertical-align: middle;
width: 100%;
}
i have edit the left menu inside your fiddle: http://jsfiddle.net/7Rgvs/