You need to add the line-height attribute and that attribute must match the height of the div to center text in a div box.
1 2 3 4 5 6 |
elementName { height: 100px; line-height: 100px; vertical-align: middle; text-align: center; } |
This code is useful to centre text inside the box vertically and horizontally.
Centered text in a box!
Great Article about centering in css