I am trying to make text float in the middle vertically. This means there should be equal padding on the bottom and top. I have tried using vertical-align: middle; but I had no luck. I also used it with display: table-cell.
Here is my code:
http://jsfiddle.net/M7Hsz/
Note, the other problem is that the text will have different lengths. So this issue is unlike other stackoverflow posts. So the solution needs to make the text float in the middle even if the text is longer/shorter
Your h2 element positioned absolute you can’t vertically align an element while you’re setting it’s position to absolute.
http://jsfiddle.net/cHjs8/1/