IE7 Web Design Issue: Centering
I’ve run into two problems that were fine in IE6, in Firefox and Opera, but that display poorly in IE7.
First, the <center> tag.
Yes, it has been deprecated for a while in favor of a <div align=”center”>. And, then, current recommendations call for creating a enclosing <div>and applying margin:auto or margin-right:auto; margin-left:auto.
But, this gets rather hairy very quickly.
With IE6, the easiest way to center a page was to use a <center /> tags. Firefox and Opera went along quietly and all was well, until IE7 came along.
Internet Explorer 7 doesn’t like <center> tags, at least with the combinations of DIVs I was using on my www.TerrysComputerTips.com site.
Although my pages are fixed now (by removing the <center> and </center> tags), IE7 initially took this same beautifully centered page — and right-aligned the DIV at a page width of about 1400 pixels.
Where it got that number, I don’t know. Idenfifying the problem was easy.
Identifying the solution wasn’t — who would have thought that removing the <center> and </center> tags would make the page center properly?
I’m not sure how I found it, other than shooting at the problem with a “what affects the whole page…that I can change” approach. But, that was it.
It’s time to lose the <center> tag.
2 Responses to “IE7 Web Design Issue: Centering”
Got something to say?

[...] I wrote the other day about the IE7 Center tag bug. IE6, Firefox 1.5.0.7, Firefox 2.0, and Opera all displayed the pages exactly the same. And, then IE7 came along… [...]
Wow, I’m having that exact problem with a site I’m working on. Everything is acting like it is glued to the right hand side of a really wide page, but only in ie7. I sure hope that this is it! Thanks for figuring it out!