ok, i had this last div centered properly ( id=“footer”), but i did something and now it refuses to center. Can anyone help educate me as to what i’m doing wrong?
html:
<!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>
<% base tag %>
$Metatags(false)
<% require themedCSS(layout) %>
<% require themedCSS(typography) %>
<title>$Title - Your Site Name</title>
</head>
<body>
<div id="container">
<div id="header">
<!-- end #header --></div>
<div id="nav">
<ul>
<% control Menu(1) %>
<li>
<a class="$LinkingMode" href="$Link" title="Go to $Title">$MenuTitle</a>
</li>
<% end_control %>
</ul>
<!--end #nav --></div>
<div id="shadow"> </div>
<div id="sidebar1">
<h3>Sidebar1 Content</h3>
<p>The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the right side of the #mainContent div if it will always contain more content. </p>
<p>Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut, sapien. Fusce metus mi, eleifend sollicitudin, molestie id, varius et, nibh. Donec nec libero.</p>
<!-- end #sidebar1 --></div>
<br class="clearfloat"/>
<div id="mainContent">
$Layout
<!-- end #mainContent --></div>
<div class="clearfloat"/></div>
<div id="footer">
<div align="center" class="footerContent">
<p>© n8peg misc. $Now.Year |
Provided by <a href="http://ssbits.com">SSbits.com</a></p>
</div>
<!-- end #footer --></div>
<!-- end #container --></div>
</body>
</html>
css:
* {
margin: 0;
padding: 0;
}
body {
font: 100% Verdana, Arial, Helvetica, sans-serif;
margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
padding: 0;
text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
color: #000000;
}
html {
background: #000000}
#container {
width: 850px; /* using 20px less than a full 800px width allows for browser chrome and avoids a horizontal scroll bar */
background: #FFFFFF;
margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
text-align: left; /* this overrides the text-align: center on the body element. */
}
#header {
width: 850px;
height: 170px;
margin: 0 auto;
overflow: hidden;
background: #58ade1 url(../images/header.jpg) repeat-x left center;
}
#shadow {
background: #58ade1 url(../images/dropShadow1.jpg) repeat-x left center;
width: 850px;
height: 8px;
}
#sidebar1 {
float: right; /* since this element is floated, a width must be given */
width: 200px; /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */
background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
padding: 15px 10px;
}
#mainContent {
margin: 0 250px 0 0; /* the right margin on this div element creates the column down the right side of the page - no matter how much content the sidebar1 div contains, the column space will remain. You can remove this margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends. */
padding: 10px 20px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
}
#footer {
padding: 0; /* this padding matches the left alignment of the elements in the divs that appear above it. */
background:#DDDDDD;
height: 130px;
width: 850px;
background-color: #999999;
}
#footer p {
margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
padding: 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
}
/* MAIN NAVIGATION - TABS
----------------------------------------- */
#nav {
background: #333;
overflow: hidden;
list-style: none;
margin: 0 auto;
padding: 0;
width: 850px;
}
#nav li {
float: left;
font: 100% "Lucida Sans Unicode", "Bitstream Vera Sans", "Trebuchet Unicode MS", "Lucida Grande", Verdana, Helvetica, sans-serif;
margin: 0;
padding: 0;
}
#nav a {
background: #333 url("../images/seperator.gif") bottom right no-repeat;
color: #ccc;
display: block;
float: left;
margin: 0;
padding: 8px 12px;
text-decoration: none;
}
#nav a:hover {
background: #2580a2 url("../images/hover.gif") bottom center no-repeat;
color: #fff;
padding-bottom: 8px;
}
.clearfloat {
clear: both;
height: 0;
font-size: 1px;
line-height: 0px;
}