Vertical-Alignin IE9

Hello Experts -
I've got a table cell without spacing, padding or a border inside of which I have some text that I want vertically centered.  Both valign=middle in the <td> tag and vertical-align:middle; in the style sheet work fine with one exception: IE9.  It shifts the text one irritating pixel upward from vertical center.  F12'ing to IE9 Compatibility View makes the shift goes away.

With a declaration of <!DOCTYPE html>, is there a reason that (non-compatibility) IE9 does this and if so is there a workaround?  Thanks all.

-- Rick
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

It does it because it has the legacy and history of IE.  IE 9 has the lowest standards compliance of any major browser.  You can spend days or even weeks trying to make it behave like a good browser, and you might even find a hack that works.  Of course there is no guarantee the hack will work with later releases of IE.

What you have to ask yourself is "does it matter" if IE does not render the same; the users don't care.  They are viewing the page in a browser, they are not comparing browser.  They are accustomed with the way their browser renders.  As long as you get an acceptable rendering is it worth an extra effort to fix IE?


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MinnRickAuthor Commented:
Yep, that's a perfectly acceptable answer to this and, quite frankly, about what I expected.  The 1px is trivial in the grand scheme - just wanted to make sure that the irregularity wasn't something basic I was overlooking.  Thanks for the response.

Thank you for understanding that sometimes there is no answer just information. :^)

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.