3 replies [Last post]
clositherapi
clositherapi's picture
Offline
newbie
Last seen: 7 years 44 weeks ago
Timezone: GMT-5
Joined: 2012-01-31
Posts: 1
Points: 2

Admittedly,
I'm not so great yet with CSS and I have been trying to center the footer on a website for a very long time... It is so frustrating to say the least...
Can anyone take a look and tell me what I am doing so wrong? Sad

/*FOOTER*/

#footer{
background:url(bg-footer.gif) repeat-x;
font:12x Arial,Helvetica,sans-serif;
text-transform:lowercase;
font-weight:normal
height:1%;
overflow:hidden;

padding:0 20px 20px;
}
#footer .holder p{color:#3f3f3f;text-align:left;}
#footer p{color:#808080;margin:0;text-align:center;
}
#footer p a{color:#808080;}

tjroberts086
tjroberts086's picture
Offline
Enthusiast
Last seen: 4 years 26 weeks ago
Timezone: GMT-5
Joined: 2010-01-08
Posts: 138
Points: 177

it would help to see the full

it would help to see the full code! but I think you should try adding margin: 0px auto; to the #footer.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 4 years 47 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

As stated a link to site or

As stated a link to site or full code is helpful.

You can't centre a block element without setting a width that is less than it's parent, then you can add margin auto to the widths to centre that element in it's parent. If the element is an inline one then text-align on the parent will effect centering.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

balajidesign
balajidesign's picture
Offline
Enthusiast
Last seen: 6 years 7 weeks ago
Timezone: GMT+5.5
Joined: 2012-01-31
Posts: 116
Points: 124

please send us the full code.

please send us the full code. or else you can find the footer container will come under main div. so please make it margin:0 auto on main div section. it will automatically came on center.