centering div

Discussion in 'CSS' started by yasirahmedis4u, Dec 18, 2011.

  1. #1
    hi guys i have develop my personal site for online games iits working fine in opera chrome etc but not working in correctly in IE
    thier is Some problem with its main container div
    its not centering.
    code:
    #main_container{
    margin: 0 auto;

    width:1024px;
    height:800px auto;
    background: #2F2F2F;
    padding:0;
    font-size:12px;
    color: #fff;
    font-family:Verdana, Arial, Helvetica, sans-serif;
    }
    you can also follow link http://funspack.com/index.php and see the problem itself.
    can anyone help....
     
    Solved! View solution.
    yasirahmedis4u, Dec 18, 2011 IP
  2. Toycel

    Toycel Peon

    Messages:
    243
    Likes Received:
    11
    Best Answers:
    4
    Trophy Points:
    0
    #2
    I have just had a look at your source code and your main container isn't labelled with the '0 Auto' just 'auto'.

    You need to enter the 'text-align: center' to the body and it should work better.

    I also don't think that anything should be above the Doctype so maybe move that down into the <Head> section?
     
    Toycel, Dec 18, 2011 IP
  3. #3
    Your site is totally invalid, improper structure and without a doctype. You are in quirks mode and will never get IE to attempt to perform like the other far more modern browsers.

    Start by moving everything in the beginning "style" into the head where it belongs. Add this to your first line: <!DOCTYPE html> . Then see where we stand.
     
    drhowarddrfine, Dec 18, 2011 IP
  4. yasirahmedis4u

    yasirahmedis4u Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    thanks drhowarddrfine your suggestion work
    and also thanks to Toycel for your fast reply
     
    yasirahmedis4u, Dec 19, 2011 IP