...

View Full Version : Center logo image with externial CSS



Len Whistler
02-24-2005, 08:46 AM
I would like to center the logo image on all pages with an external CSS file. Below I have the CSS code but can't figure out the code to center the image, what do I need to add?



body {
margin:0px;
padding:0px;
font-family:verdana, arial, helvetica, sans-serif;
color:#333;
background-color:white;
background-image: url(logo.jpg);
background-repeat: no-repeat;
}

Thanks

Leonard Whistler
www.stubby.ca

rmedek
02-24-2005, 08:55 AM
You could center it and put the other rules all together like so:


background: url(logo.gif) no-repeat top center #fff;


or if you want to keep it longhand just add:


background-color:white;
background-image: url(logo.jpg);
background-repeat: no-repeat;
background-position: top center;


"top" could be top, center, or bottom... here's the w3schools page on this:

http://www.w3schools.com/css/css_reference.asp#background

Hope this helps,

rmedek
02-24-2005, 08:57 AM
* deleted *

Len Whistler
02-24-2005, 04:54 PM
Thanks rmedek


Leonard Whistler
www.stubby.ca



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum