IronPegasus
06-04-2006, 03:14 AM
Hello,
I am having troubles centering all the contents on my page. Here's an image of my errors in IE:
http://img149.imageshack.us/img149/79/temp0kt.jpg
Here's what I am trying to achieve:
http://img149.imageshack.us/img149/9426/temp24my.jpg
FireFox is similar, only all the contents are lined up on the left side of the page.
Now for the code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Entity Games</title>
<style type="text/css">
body{
background-color: rgb(34,57,83);
font-family: Tahoma;
font-size: 12px;
text-align: center;
}
.header{
background-color: rgb(71,119,171);
color: rgb(0,0,0);
height: 100px;
width: 768px;
font-size: 42px;
}
.menubg{
background-color: rgb(0,0,0);
color: rgb(255,255,255);
width: 768px;
height: 40px;
}
.menu a{
text-decoration: none;
background-color: rgb(0,0,0);
color: white;
height: 20px;
width: 80px;
border-color: rgb(72,72,72);
}
.menu a:hover{
text-decoration: none;
background-color: rgb(80,80,80);
color: white;
height: 20px;
width: 80px;
}
img.h {
width: 768px;
height: 7px;
border: none;
display: block;
}
.content{
background-color: rgb(255,165,0);
color: white;
height: 350px;
width: 550px;
float: left;
}
.subnav{
background-color: rgb(0,0,0);
color: rgb(255,255,255);
width: 109px;
height: 350px;
float: left;
}
</style>
</head>
<body>
<div class="header">
<font style="color: rgb(255,165,0)">Entity</font>Games
</div>
<img src="images/th.bmp" class="h">
<div class="menubg">
<div class="menu">
<a href="">Home</a>
<a href="">Projects</a>
<a href="">About</a>
<a href="">Articles</a>
<a href="">Forums</a>
</div>
</div>
<img src="images/bh.bmp" class="h">
<div class="subnav">
random text<br />
random text<br />
random text<br />
random text<br />
random text<br />
random text<br /><br />
random text<br />
random text<br />
random text<br />
random text<br />
random text<br />
random text<br />
</div>
<div class="content">
Some more random text
</div>
<div class="subnav">
random text<br />
random text<br />
random text<br />
random text<br />
random text<br />
random text<br />
</div>
</body>
</html>
I'm new to CSS, so could someone be kind enough to show me a solution to this problem?:o)
I am having troubles centering all the contents on my page. Here's an image of my errors in IE:
http://img149.imageshack.us/img149/79/temp0kt.jpg
Here's what I am trying to achieve:
http://img149.imageshack.us/img149/9426/temp24my.jpg
FireFox is similar, only all the contents are lined up on the left side of the page.
Now for the code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Entity Games</title>
<style type="text/css">
body{
background-color: rgb(34,57,83);
font-family: Tahoma;
font-size: 12px;
text-align: center;
}
.header{
background-color: rgb(71,119,171);
color: rgb(0,0,0);
height: 100px;
width: 768px;
font-size: 42px;
}
.menubg{
background-color: rgb(0,0,0);
color: rgb(255,255,255);
width: 768px;
height: 40px;
}
.menu a{
text-decoration: none;
background-color: rgb(0,0,0);
color: white;
height: 20px;
width: 80px;
border-color: rgb(72,72,72);
}
.menu a:hover{
text-decoration: none;
background-color: rgb(80,80,80);
color: white;
height: 20px;
width: 80px;
}
img.h {
width: 768px;
height: 7px;
border: none;
display: block;
}
.content{
background-color: rgb(255,165,0);
color: white;
height: 350px;
width: 550px;
float: left;
}
.subnav{
background-color: rgb(0,0,0);
color: rgb(255,255,255);
width: 109px;
height: 350px;
float: left;
}
</style>
</head>
<body>
<div class="header">
<font style="color: rgb(255,165,0)">Entity</font>Games
</div>
<img src="images/th.bmp" class="h">
<div class="menubg">
<div class="menu">
<a href="">Home</a>
<a href="">Projects</a>
<a href="">About</a>
<a href="">Articles</a>
<a href="">Forums</a>
</div>
</div>
<img src="images/bh.bmp" class="h">
<div class="subnav">
random text<br />
random text<br />
random text<br />
random text<br />
random text<br />
random text<br /><br />
random text<br />
random text<br />
random text<br />
random text<br />
random text<br />
random text<br />
</div>
<div class="content">
Some more random text
</div>
<div class="subnav">
random text<br />
random text<br />
random text<br />
random text<br />
random text<br />
random text<br />
</div>
</body>
</html>
I'm new to CSS, so could someone be kind enough to show me a solution to this problem?:o)