...

View Full Version : Centering boxes



billvasko
01-17-2008, 08:49 PM
I have some boxes on my site that appear on the right side of the screen. I would like to center them on the page. If you look at the page source, you'll see I am using HTML code, so maybe I am limited. I have tried modifying this piece of code:

<div id="body-right">

changing it to this:

<div id="body-center">

This works for centering everything, however, the boxes disappear! Any thoughts? Thanks! link --> www.maxxtraining.com/coaching.htm

Excavator
01-17-2008, 09:10 PM
Hello billvasko,
It's going to be easier to center things if you have a doctype. Check the links in my sig or the sticky at the top of this forum.

I see now you have one, you just have a <title> above it. Make your doctype the very first line.
You will need some changes to get XHTML strict to validate.

Excavator
01-17-2008, 09:38 PM
Right now, #body-right {float: right;width: 384px;} has your boxes going over to the right.

Change this to
#body-right {
width: 384px;
margin: 0 auto;
}
and your boxes will center.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum