2 replies [Last post]
glengall
glengall's picture
Offline
newbie
Ayr, Scotland
Last seen: 14 years 45 weeks ago
Ayr, Scotland
Joined: 2007-01-12
Posts: 7
Points: 0

Hi there I am very new to CSS etc. and I can't get the whole site to center on the page no matter what I do.

The page you can see at:

"http://www.thetartanbox.com/Test/template2.htm"

Thanks

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

To center an element with a

To center an element with a fixed width you use margin:auto.

Remove those divs that you have attribute align="centre" (it's not valid! ) on and work just on the #wrap div with margin:0 auto;

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

glengall
glengall's picture
Offline
newbie
Ayr, Scotland
Last seen: 14 years 45 weeks ago
Ayr, Scotland
Joined: 2007-01-12
Posts: 7
Points: 0

Worked a treat. Thanks for

Worked a treat. Thanks for your help.