1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Background color for png image

Discussion in 'CSS' started by wholesalechecklist, Dec 1, 2007.

  1. #1
    http://www.missionenvironment.com/index1.html

    See my top image logo? I set the bgcolor in the css. Am I doing this right? I feel like the way I did it is not as efficient as it should be.
     
    wholesalechecklist, Dec 1, 2007 IP
  2. Stomme poes

    Stomme poes Peon

    Messages:
    3,197
    Likes Received:
    135
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The background for the body? Why would that be inefficient?

    What you need to watch out for is IE6 and under.

    Here's a pic:

    (hopez this workz)

    There's a Js file called PNGfix but tell ya what's easier... make it a gif OR make it a jpg with the background colour added to it. Adding the background colour to the Png apparently doesn't match right in IE 6 or 7 because it fcks with the colour a bit and they won't match. Don't quote me on this though.

    Image taken with Fake IE6 4 Linux.
     

    Attached Files:

    Stomme poes, Dec 2, 2007 IP
  3. soulscratch

    soulscratch Well-Known Member

    Messages:
    961
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    105
    #3
    Don't use a PNG for that. Use a GIF with a matte color, since the background is solid. I'd only use PNG if there's something complex in the background, and a GIF's file size will be much smaller.
     
    soulscratch, Dec 2, 2007 IP
  4. Stomme poes

    Stomme poes Peon

    Messages:
    3,197
    Likes Received:
    135
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yup. The only advantage to the png transparency is if you were unsure of which background colour you'd have. With Gif, if you use the matte, you cannot change the background colour of the page without seeing the outline.
     
    Stomme poes, Dec 2, 2007 IP