Weird, DIV should be centered but isn't? (IE)
Posted: Thu, 2008-05-15 14:54
So I have this code here, which includes my content div (mainMaavar), it should be centered in Ie as it appears in FF but it just isn't. I have no idea why.. Help please?
<html>
<head>
<title>Untitled</title>
</head>
<body>
<style type="text/css">
.mMain
{
width:100%;
}
.mainMaavar
{
width:750px;
height:450px;
background:#ECF5FC;
margin:10px auto;
direction:rtl;
}
</style>
<div class="mMain">
<div class="mainMaavar">
</div>
</div>
</body>
</html>

Enthusiast
Posts: 273
Joined: 2008-02-22
Location: Providence, RI
Well, there are a few things
Posted: Thu, 2008-05-15 16:09
Well, there are a few things wrong here. You do not have a doctype number one. Number two you have your styles in your body, they belong in the head. You do not need to specify a width 100% as a div is a block level element.
http://ifohdesigns.com - Web Design That Is Neat.
http://ifohdesigns.com/blog - Read it please.
newbie
Posts: 4
Joined: 2008-04-27
You are correct about these
Posted: Sun, 2008-05-18 07:07
You are correct about these being wrong but it's not the source of my problem, as you can see I've updated the code but the problem remains:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<style type="text/css">
.mainMaavar
{
width:750px;
height:450px;
background:#ECF5FC;
margin:10px auto;
}
</style>
</head>
<body>
<div class="mMain">
<div class="mainMaavar">
</div>
</div>
</body>
</html>
Elder
Posts: 1079
Joined: 2004-08-14
Try a doctype that
Posted: Sun, 2008-05-18 15:05
Try a doctype that works:
http://csscreator.com/node/18218