CSS "Width" IE help!

pushVTEC

Senior member
Aug 30, 2003
265
0
0
Ok so now I got the width to be 900 by making a new div for the entire body and resizing that div. Now the problem is I can't get it to float in the center of the screen. Margin 15px auto; works fine for netscape and firefox type browsers but not IE
 

pushVTEC

Senior member
Aug 30, 2003
265
0
0
Ok so I fixed the width, why wont it float in the center now? Here is my css for the "the_body" div

#the_body{
background-color: #BACFE7;
min-height: 800px;
width: 900px;
margin: auto;
}
 

screw3d

Diamond Member
Nov 6, 2001
6,906
1
76
Originally posted by: pushVTEC
Ok so I fixed the width, why wont it float in the center now? Here is my css for the "the_body" div

#the_body{
background-color: #BACFE7;
min-height: 800px;
width: 900px;
margin: auto;
}

instead of margin: auto;, use this instead:

margin-left: auto;
margin-right: auto;
 

pushVTEC

Senior member
Aug 30, 2003
265
0
0
Originally posted by: screw3d
Originally posted by: pushVTEC
Ok so I fixed the width, why wont it float in the center now? Here is my css for the "the_body" div

#the_body{
background-color: #BACFE7;
min-height: 800px;
width: 900px;
margin: auto;
}

instead of margin: auto;, use this instead:

margin-left: auto;
margin-right: auto;

nope, still stuck hanging on the left :(
 

screw3d

Diamond Member
Nov 6, 2001
6,906
1
76
Originally posted by: pushVTEC
Originally posted by: screw3d
Originally posted by: pushVTEC
Ok so I fixed the width, why wont it float in the center now? Here is my css for the "the_body" div

#the_body{
background-color: #BACFE7;
min-height: 800px;
width: 900px;
margin: auto;
}

instead of margin: auto;, use this instead:

margin-left: auto;
margin-right: auto;

nope, still stuck hanging on the left :(

oh right.. try adding this:

body {
text-align: center; //set div to center in IE
}

#the_body {
text-align: left; //reset text alignment to left
}
 

pushVTEC

Senior member
Aug 30, 2003
265
0
0
Originally posted by: screw3d
Originally posted by: pushVTEC
Originally posted by: screw3d
Originally posted by: pushVTEC
Ok so I fixed the width, why wont it float in the center now? Here is my css for the "the_body" div

#the_body{
background-color: #BACFE7;
min-height: 800px;
width: 900px;
margin: auto;
}

instead of margin: auto;, use this instead:

margin-left: auto;
margin-right: auto;

nope, still stuck hanging on the left :(

oh right.. try adding this:

body {
text-align: center; //set div to center in IE
}

#the_body {
text-align: left; //reset text alignment to left
}

Awesome that worked, thanks a lot! Now I just need to figure out how to get my reasons boxes to line up properly in IE and netscape/mozilla. Looks PERFECT in mozilla right now, arg.