views:

16

answers:

1

i have this css box(div) that on mozilla firefox displays in the middle of the browser, but on the IE, it floats to the left, could you tell me what the issue is?

#div-regForm,.registered{
    border:3px solid #eeeeee;
    padding:15px;
    background:white;
    color:black;
    margin:30px auto 40px auto;
    width:600px;

}

html:

<div id="div-regForm">

</div>

how can i make them it wokr on ie, thanks!

A: 

Use a Doctype that triggers Standards mode. If IE doesn't recognize auto margins then it is either IE 5.5 (or earlier) or in Quirks mode.

HTML 4.01 Strict is a good bet if you are in doubt:

  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
     "http://www.w3.org/TR/html4/strict.dtd"&gt;

It is worthwhile validating as well.

David Dorward
loool sorry i dont know what you mean, im a bit stupid lol :)) im using internet explorer 8
getaway
I've expanded the answer and added links.
David Dorward
i validated everything, but its not working, its not going in the middle
getaway
If you have a standards mode Doctype, then all else being equal, it should work. If it doesn't, then the problem probably has something to do with the wider context of the document, and I can't guess what it is from the snippit you've provided.
David Dorward