Forum Moderators: not2easy

Message Too Old, No Replies

Div centered okay in all but MSIE, what is wrong?

using margin:auto, works in Mozilla etc, doesn't work in MSIE

         

badbadmonkey

2:31 pm on Jun 10, 2009 (gmt 0)

10+ Year Member



I'm using the following CSS to define the major divs for my layouts:


.abc {
width: 740px;
border: 0;
margin-left: auto;
margin-right: auto;
}

.xyz {
width: 520px;
padding: 20px;
margin-top: 250px;
-moz-border-radius: 10px; -khtml-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px;
}

<div class="abc">
works just fine. Now, when I want to bring in the changes made in xyz, on a different page, I use
<div class="abc xyz">
.

That works just fine and as expected in Mozilla etc. But in MSIE, it's left-aligned.

Anyone see what's wrong with that?

rocknbil

2:55 pm on Jun 10, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Doctype? Rendering in Standards Compliance Mode or Quirks Mode? Quirks mode would do it . . .

badbadmonkey

3:13 pm on Jun 10, 2009 (gmt 0)

10+ Year Member



Yep! I had forgot to include the doctype (xhtml transitional) declaration for the page in question.

A reminder to always set it...