Im finally trying to move away from tables and Ive set up a test page using divs. Everything is going great with the virtical positioning of them but Id like the whole thing to be centred in the middle the screen.
Here is the code:
And the CSS:
Ignore the daft colours was just using them to make sure I knew what was what etc.
Ive tried moving the position of the container div but Im not getting it to go the way I want it to!! Tried google but it keeps coming back with text alignment tutorials so may be searching for the wrong phrase?
Thanks, Mark
Here is the code:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
<title>DIV Test</title>
</head>
<body>
<div id="container">
<div id="logo">
<p>Logo</p>
</div>
<div id="navbar">
<p> Navbar </p>
</div>
<div id="banner">
<p> Banner </p>
</div>
<div id="main">
<p> Main </p>
</div>
<div id="footer">
<p> Footer </p>
</div>
</div>
</body>
</html>
And the CSS:
Code:
#container {width:1024px;
height:1030px;
}
#logo {width: 1024px;
height:150px;
position:absolute;
top:0px;
font-size:36px;
background-image:url(../images/logo.jpg');
}
#navbar {width: 1024px;
height:100px;
position:absolute;
top:150px;
background-color:#000000;
}
#banner {width: 1024px;
height:200px;
position:absolute;
top:250px;
background-image:url(../images/banner1.gif');
background-color:#666600;
}
#main {width: 1024px;
height:500px;
position:absolute;
top:450px;
background-color:#FFFFFF;
}
#footer {width: 1024px;
height:80px;
position:absolute;
top:950px;
background-color:#FF00FF;
}
body {background-image:url(../images/background2.jpg');
background-repeat:repeat;
}
Ignore the daft colours was just using them to make sure I knew what was what etc.
Ive tried moving the position of the container div but Im not getting it to go the way I want it to!! Tried google but it keeps coming back with text alignment tutorials so may be searching for the wrong phrase?
Thanks, Mark