background-image transparency

nilulk's picture

They have: 2 posts

Joined: Apr 2009

Hey
Im having some trouble with some background-images backgrounds not being transparent when used as background-image in css! The images have been formatted okay and theyre backgrounds are transparent when the images aren't used as background-images. Is there a work around to get the images to display as intended as background-images?

Thanks in advance

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

Which browser are you having the problem in?

decibel.places's picture

He has: 1,494 posts

Joined: Jun 2008

are the images GIF or PNG?

if PNG you may need pngfix for IE6 and earlier

if the site is online can you post a link?

[EDIT]

Here is a test html page (transbgimg.html attached) using a transparent PNG image with no green in it, with a green body bg.

<style>
body {background: green url('http://www.webmaster-forums.net/files/Brown_shield_transbg.png') repeat;}
</style>

greg's picture

He has: 1,581 posts

Joined: Nov 2005

Welcome to TWF Smiling

nilulk wrote:
...not being transparent when used as background-image in css...
If it is ONLY when you use them as background images in CSS, and they work when called elsewhere, then it seems you are using a correct image (png etc) for transparency.

So my "guess" would be you assign a background colour on either the div the image(s) is in, or a background colour on a parent div the image is in.

It is only a guess, as we need a bit more info as per the questions above.

nishu12's picture

They have: 3 posts

Joined: Apr 2009

background: trasparent url(../../) 0 0 no-repeat;

Layette Clothes

greg's picture

He has: 1,581 posts

Joined: Nov 2005

So which image is it you are having problems with?

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.