Quote:
Originally posted by Dave
This is my ugly and unreliable solution to the problem at hand. It's main issue is that it doesn't work if your text overflows into more than one line.
Code:
<div style="height: 100px; width: 100px; border: 1px solid rgb(0,0,0); text-align: center; padding: 0; margin: 0;">
<p style="vertical-align: middle; line-height: 98px; font-size: 12px;">
Blah blah blah.
<p>
</div>
This is one of those things that's painful due to the css spec not really defining any property for doing the job. Other than a few faults like this css is a good thing, now if only people would stop using tables for all their positioning.
|
I wound up fixing it by using the
top property on the paragraph to bring it down.
I think the W3C needs to address this. Seriously.