Weird, DIV should be centered but isn't? (IE)

novastella
avatar
rank newbie

newbie


Posts: 4
Joined: 2008-04-27

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>

ifohdesigns
ifohdesigns's picture
rank Enthusiast

Enthusiast


Posts: 273
Joined: 2008-02-22
Location: Providence, RI

Well, there are a few things

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.

novastella
novastella's picture
rank newbie

newbie


Posts: 4
Joined: 2008-04-27

You are correct about these

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>

DanA
DanA's picture
rank Elder

Elder


Posts: 1079
Joined: 2004-08-14

Try a doctype that

Try a doctype that works:
http://csscreator.com/node/18218