Transparent Image Background

How do I make an image’s background transparent? I’ve seen it done virtually everywhere, yet can’t find a single google search result on this.

If you want to make a complete image transparent, add the ‘opacity’ property, and set its value between 0 and 1 for ‘img’ element.
If you want the background not to be visible around smth in the image that is visible, like the following:

you should edit that image in e.g. Photoshop and save it in .png format, or to use some other approach:

1 Like

Use remove.bg
Also, I would move this post to General, since this isn’t a question about code.

Ah, understood! A link to the image with the transparent background or a direct download of it probably won’t do, since transparency (or at least, transparency encoding that html images use?) would not be kept.

remove.bg doesn’t seem to comply with html transparency encoding, so I found a different website. After uploading to imgur and grabbing the link, everything now works fine!

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.