Vertically centred text in CSS
InternetPonPonPon!
As a guy who knows zippo about web design, I just discovered something incredible. If you want to vertically centre a line of text in a block level element, simply define the line-height equal to the height of the container.
#SomeContainer { display:block: height:128px; line-height:128px; /* vertical */ text-align:center; /* horizontal */ width:128px; }
Assuming you’re not parsing this in a blog aggregator that strips out CSS from RSS feeds (how’s that for some TLA TLC) you should see an example of it on the right.