Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Using images that contain transparent backgrounds

Is there a way to insert an image of i.e. a car with a completely transparent background while the car stays fully opaque?

Bit difficult to word correctly, sorry for any confusion. :)

1 Answer

Not sure if I get what you mean. Basically, you want CSS to help you remove the background of your image right?

I don't think that's possible right now.

There is another way, maybe you can find an image with png extension, they often have a transparent background. Or, you can just edit your image using a software.

So if I have a picture that already has an existing transparent background, will CSS recognize that?

Depends... How are you gonna use the image?

If you just want to insert the image into webpage then you can use HTML img tag. If you want to use the image as background, then CSS is the way to go. Just treat the transparent background image as your regular image, jack. They work the same.

Hope it help. :)