Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Location
    Vancouver, BC Canada
    Posts
    1,323
    Thanks
    26
    Thanked 100 Times in 100 Posts

    Center logo image with externial CSS

    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
    Leonard Whistler

  2. #2
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    You could center it and put the other rules all together like so:
    Code:
    background: url(logo.gif) no-repeat top center #fff;
    or if you want to keep it longhand just add:
    Code:
    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_ref...asp#background

    Hope this helps,
    Last edited by rmedek; 02-24-2005 at 09:00 AM.

  3. #3
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    * deleted *
    Last edited by rmedek; 02-24-2005 at 09:00 AM. Reason: double post... d'oh

  4. #4
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Location
    Vancouver, BC Canada
    Posts
    1,323
    Thanks
    26
    Thanked 100 Times in 100 Posts
    Thanks rmedek


    Leonard Whistler
    www.stubby.ca
    Leonard Whistler


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •