...

View Full Version : CSS Aligning to middle



cooleo100d
02-02-2005, 04:55 AM
Hi,

If you go to http://www.gamescool.com/dfox/index.php you will notice that in the top box, the little house image and logo text are not aligned to the middle of the box. I am trying to align them to the middle. I have tried things like vertical-align: middle; but it has not works. In Firefox, both are almost aligned to the middle. In internet explorer, they are not even close. How can I line the image and the text image to the middle of the box?

Thanks for your help,
~David

hemebond
02-02-2005, 06:43 AM
div.title_bar
{
text-align:center;
}

ronaldb66
02-02-2005, 10:07 AM
Just to make things clear: do you mean vertical or horizontal alignment?

For horizontal (left-to-right) alignment, hemebond's suggestion should do the trick since all the content you have in there is inline; for vertical (top-to-bottom) alignment, experiment with margins / padding on the parent element (the "title_bar" div) to force the images up more. It would probably look better to have them both sit on a common base line rather then actually being vertically centered anyway.

cooleo100d
02-02-2005, 08:59 PM
Hi,

Stupid mistake on my part. I mean verticaly in the box. I will use padding or a margin to align one part of them, which is easier, and may look nicer like ronald said.

Thanks for your help,
~David



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum