IE7 is Centering My CSS-Controlled Text

IE7 is Centering My CSS-Controlled Text by David Whelan When IE7 was in beta, I noticed that a Joomla site I’ve been working on was always centered. I mean, everything – all text, menus, etc. – were centered within their elements. Since the sites looked fine in IE6 and Firefox 1.5, I didn’t sweat it. I installed IE7 when it came out and I notice that the centering problem is still there.

By default, Plone starts with a 100% wide skin.  I don’t think it’s awful but it’s not what I wanted to use.  So I downloaded a few skins and then started tweaking my own site to create a custom, pixel-width site.  Lo and behold, regardless of other layout problems that seem to be IE-related (spacing, margins, etc.), everything was centered on the page!  Since I’d only customized my main_template and created a couple of styles in PloneCustom.css, I couldn’t see how it was something that I’d done.

But it was.  When I backed up my custom plone_skin folder and went back to a plain vanilla skin, everything laid out properly.  Once again, the inestimable Mr. Limi has CSS guidance due to IE7, but it didn’t apply.  So I’m going to start from scratch (it’s like Microsoft software – the first two runs at the hedge involve a briar scrapes on the face, but the third usually only ends in a broken leg as you land on the other side) and see if I can figure out why it was centered.  Yes, for anyone who is going to ask, I did use a center tag.

Update 11.11.2006:  found this snarky thread where Vorpal Chortler asked a similar question.  The fix suggested in the thread worked.  IE 6 and apparently 7 will apparently sometimes center the text in a table by default.  I edited my PloneCustom.css file to include a table { text-align: left; } style and this fixed the problem.  I hadn’t noticed this in IE6 but perhaps it was fixed by the browser developers(?).

Document Actions
David Whelan

I improve information access and lead information teams. My books on finding information and managing it and practicing law using cloud computing reflect my interest in information management, technology, law practice, and legal research. I've been a library director in Canada and the US, as well as directing the American Bar Association's Legal Technology Resource Center. I speak and write frequently on information, technology, law library, and law practice issues.