dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: IE page centering not working

  1. #1
    Join Date
    Nov 2009
    Posts
    32

    IE page centering not working

    Hi!

    I am giving

    #main_outer_container
    {
    width: 1000px;
    margin:auto;
    }

    It centers the div properly in all browsers except IE.
    What am i missing here?

    The link is http://www.mukulabdagiri.com

    Thanks!

  2. #2
    Join Date
    Mar 2010
    Posts
    2
    IE interprets the auto setting differently to other browsers when it's applied to the margins.
    You need to do the following for it to work...

    Center the body

    body {
    text-align: center;
    }

    Then tell the container div to align it's contents to the left

    #main_outer_container
    {
    width: 1000px;
    margin:auto;
    text-align:left;
    }

    That should do it!

  3. #3
    Join Date
    Mar 2010
    Posts
    2
    This is really a CSS question though - Perhaps someone will move it over there.

  4. #4
    Join Date
    Aug 2006
    Posts
    1,943
    First step is always to have a doctype, on the first line of your html file, otherwise the browser is in "quirks mode". That seems to be the cause of 99% of "ie doesn't work" issues.

    I didn't go thru your entire code, but on first blush your centering css seems fine.

    Dave

  5. #5
    Join Date
    Nov 2009
    Posts
    32
    body {
    text-align: center;
    }

    was missing. it solved the problem.
    Thanks a lot!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles