PDA

View Full Version : centering problem (please help)



disdisdistort
Feb 2nd, 2010, 11:40 PM
i'm having a lot of trouble centering the main section of this website. please take a look at my code and see if you can help. thank you.

http://keepourfireburning.webs.com/

met
Feb 3rd, 2010, 02:18 AM
#content { margin:20px auto; }


if you want to keep the top and bottom margin, else just auto.

Excavator
Feb 3rd, 2010, 03:01 AM
Hello disdisdistort,
Met has the answer for you. That or margin: 0 auto; will work for you.

To center an element you need 3 things:

a DocType declaration
an element with a width
that elements left/right margins set to auto

disdisdistort
Feb 3rd, 2010, 04:41 AM
thanks a lot everyone!