2 replies [Last post]
babrees
babrees's picture
Offline
Enthusiast
England,UK
Last seen: 14 years 11 weeks ago
England,UK
Joined: 2007-07-25
Posts: 63
Points: 0

http://www.123club.co.uk/default/

I have following nested in this order:

div id="container"
div id="header"
div id="leftside"
div id="main"

and then under the container I have

div id="footer"

This is my css code for those and body...

#container{
width: 800px;
background-color:#FFFFFF;
background-image:url(../images_default/bgcontainer.gif);
background-repeat:repeat-y;
border-left: ridge 2px #996600;
border-right: ridge 2px #996600;
text-align:left; /*center hack*/
padding:0px;
overflow: hidden;
margin: auto;
}

#header {
width:800;
height:145px;
background-image: url(../images_default/bgheader.jpg);
background-repeat: repeat-x;
padding:0px;
}

#leftside {
width:190px;
font-size: 12px;
color: #9C120F;
padding-top: 15px;
padding-left:2px;
float: left;
border-top: ridge 2px #996600;
margin-top: 0;
}

#footer {
clear: both;
background-image: url(../images_default/headerbg.jpg);
background-repeat: repeat-x;
padding: 10px;
font-size: 10px;
color: #FFFFFF;
width:800px;
border-right: ridge 2px #996600;
border-left: ridge 2px #996600;
}

BODY
{
background-color: #CCCCCC;
background-image: url(../images_default/bg.jpg);
font-family: verdana, arial;
font-size: 12px;
margin:0;
text-align:center;
}

Despite having text-align:center in the body, the footer is still left aligned. How do I get it to center and align with the container div?

-------
Jill

jhenderson
Offline
newbie
Last seen: 14 years 43 weeks ago
Joined: 2007-12-03
Posts: 1
Points: 0

Hi babrees, Add "margin: 0

Hi babrees,

Add "margin: 0 auto;" to the footer class - you did something similar for the container class, but you have forgotten that the footer needs it too. By the way, I think the footer is too wide - 780px perhaps?

Good luck!

babrees
babrees's picture
Offline
Enthusiast
England,UK
Last seen: 14 years 11 weeks ago
England,UK
Joined: 2007-07-25
Posts: 63
Points: 0

Perfect! Thanks!

Perfect! Thanks!

-------
Jill