Log in

View Full Version : Centering site logo in Header



igotregistered
04-20-2010, 05:49 PM
Hello,

I have a question about header graphics.

I have four graphics which I'd like to have set up in two rows.

The first graphic will be buy itself as the site logo centered, directly below will be the three others which I'd like to span across, one on the left, one in the center and one on the right.

Right now I have that setup but when the window is set at different resolutions the top center graphics move a little to the left or a little to the right depending on the resolution and goes off center.

How can I stop it from doing that and staying centered?

Thank you

BLiZZaRD
04-20-2010, 06:06 PM
Use percentage declarations in your CSS, after setting the base margins and padding to 0.

Your CSS would look something like this:



* {
margin: 0;
padding: 0;
}

.header img {
margin-left: auto;
margin-right: auto;
width: 60%;
}


Of course the number (60%) is a guess, you will have to play around with it to get it centered, the margin: auto sets it center when a width is declared. For the other 3, just float them, left, center and right. inside the same div or p.

diju
04-22-2010, 11:45 AM
Why dont you just use (text-align:center) into your header css