Log in

View Full Version : What's wrong with this code?



Meti
21-07-2008, 04:15 PM
Hey,
I'm currently coding a layout for one of my customers. It's like 99% done, but I'm having a problem. The navigation isn't in centered, which it should be.
Here's the code. Please help me ;)


<!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-Language" content="sv">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Index1</title>
<style type="text/css">
<!--
body {
background-image: url(images/bg.png);
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #000000;
margin: auto;
}
#container {
width: 956px;
margin: auto;
}
#banner {
background-image:url(images/banner3.png);
width: 593px;
height: 126px;
padding-left: 0px;
padding-top: 14px;
}
#navigation {
background-image: url(images/header2.png);
width: 851px;
height: 61px;
}
#leftcont {
width: 209px;
float: left;
}
#blue_box {
background-image: url(images/add_1.png);
width: 209px;
height: 20px;
padding-top: 10px;
}
#footer {
background-image: url(images/footer_bot.png);
width: 209px;
height: 20px;
-->
</style></head>
<body>
<!-- Layout designed and coded by MetiDesigns.com -->
<!-- Start banner and navigation -->
<div id="container">
<div id="banner" style="width: 968px; height: 126px" align="left"><br>
<a href="http://vivhosting.net">
<img border="0" src="images/logo.png" width="431" height="91"></a></div>
<div id="navigation" style="width: 853px; height: 57px" align="center">
<br>
<font face="Arial"><br>
</font><font color="#FFFFFF" face="Verdana" size="3"><b>LINK | LINK | LINK |
LINK | LINK | LINK | LINK | LINK | LINK | LINK </b></font></div>
<!-- End banner and navigation -->
<!-- Start left column -->
<div id="leftcont">
<div id="blue_box" style="width: 209px; height: 157px"><center><br>
<font color="#FFFFFF"><b>Hosting Package Description</b><br>
TEXT<br>
TEXT<br>
TEXT<br>
TEXT<br>
TEXT<br>
TEXT<br>
TEXT<br>
TEXT<br>
TEXT<br>
TEXT</font></center></div>
<div id="blue_box" style="width: 209px; height: 162px"><center>
<font color="#FFFFFF"><b><br>
Hosting Package Description</b><br>
TEXT<br>
TEXT<br>
TEXT<br>
TEXT<br>
TEXT<br>
TEXT<br>
TEXT<br>
TEXT<br>
TEXT<br>
TEXT</font></center></div>
<div id="footer" style="width: 998px; height: 34px"><center>
<font color="#FFFFFF"><br>
<b>Copyright © CustomersSite.net 2008+&nbsp;&nbsp; |All your links here |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Layout designed and coded by MetiDesigns.com</b></font><br></center></div>
</div>
</body>
</html>

redtom
23-07-2008, 12:44 PM
The text is centred to the width you have set for your div (navigation), but as you've set the widths twice for some reason it's using the width you set last what’s 853px. You'll need to sort out the sizes of your divs. Remember that you only have to set the widths and everything once for a div in the style area of the header or on the style sheet, there’s no need (well for what you doing) to set them in the div tag it's self

Want to hide these adverts? Register an account for free!