logo
            Lost Password?   No Account Yet? Register
  • Home
  • Tutorials
  • Rapid Forum
    • Demo
    • Backend Screenshots
    • Installation for Beginners
    • Roadmap
  • Support Forum
    • Bug Tracker
  • About
Joomla Handbook
Getting Started
Joomla Control Panel
Joomla Mechanics
Content Editor Screen
Add Content
Add Menu Link
Add Photos/Images
Add Links
Add PDFs
Add Events
Add Video
Add Admins


Help
My Content Is Locked
Funny Characters
Funny Paragraph Spaces
Administrators
How-To's (12)
FAQs (3)
Developers
Getting Started (for newbies) (2)
Architecture (1)
Templates (4)
CSS (1)
Extensions (7)
CSS
How to center your outter div tag in IE
Sunday, 10 February 2008
It's possible to center your outter div tag in IE without regressing to table tags. Many hacks offered in forum posts returned by Google searches don't work. Developers offer these recommendations confidently, and then you try it, and nothing. How do these posts have such high Google rankings I wonder. This solution worked for me, finally.

Say your main div tag looks like this:

<div id="main">
  <div id="header"></div>
</div>

And you want the div "main" to be say, 900px, and centered in the middle of any browser (yes, including IE). These are the styles that you need. Add the attributes to these existing styles

body {
    text-align: center;
}

and

#main {
    width:900px;
    margin: 0 auto 0 auto;
    text-align: left;
    }   

Add Comment (0)