I have a div which I need to center vertically its content:
Free coffee for all the people who visit my restaurant&l
If your inner div has a flexible height you can center it using CSS transforms:
#coffee {
width: 300px;
position:relative;
}
#coffee > div {
background:#ddffff;
position:absolute;
top:50%;
max-height:100%;
-webkit-transform:translateY(-50%);
-moz-transform:translateY(-50%);
transform:translateY(-50%);
}
http://jsfiddle.net/2Mb39/16/