Software, your way.
burger menu icon
WillMaster

WillMaster > LibraryWeb Content Preparation

FREE! Coding tips, tricks, and treasures.

Possibilities weekly ezine

Get the weekly email website developers read:

 

Your email address

name@example.com
YES! Send Possibilities every week!

Image Transparency

This is a quick how-to for publishing images with a transparency.

Perhaps your image is overlaying text. Maybe overlapping other images. Or it's just too bright for the surrounding content.

Whatever reason you have for making an image all or partially transparent, it can be done with the CSS opacity property.

opacity:100%;100% opaque
No transparency
opacity:50%;50% opaque
Half transparent
opacity:0%;0% opaque
Totally transparent

As an illustration, the next three images have opacity:100%;, opacity:50%;, and opacity:25%;, respectively. You can see the differences.

I won't demonstrate an image with opacity:0%; because there would be nothing to see.

Here is the source code for the above three images:

<img
  src="https://www.willmaster.com/possibilities/images/flowerscompositionhyperdet_45528894.png"
  style="max-width:100%; opacity:100%;">
<img
  src="https://www.willmaster.com/possibilities/images/flowerscompositionhyperdet_45528894.png"
  style="max-width:100%; opacity:50%;">
<img
  src="https://www.willmaster.com/possibilities/images/flowerscompositionhyperdet_45528894.png"
  style="max-width:100%; opacity:25%;">

As you can see, it is fairly simple.

In your CSS, give your image the opacity property and state a percentage. The higher the percentage, the more opaque. And the less the percentage, the less opaque.

(This content first appeared in Possibilities newsletter.)

Will Bontrager

Was this article helpful to you?
(anonymous form)

Support This Website

Some of our support is from people like you who see the value of all that's offered for FREE at this website.

"Yes, let me contribute."

Amount (USD):

Tap to Choose
Contribution
Method

All information in WillMaster Library articles is presented AS-IS.

We only suggest and recommend what we believe is of value. As remuneration for the time and research involved to provide quality links, we generally use affiliate links when we can. Whenever we link to something not our own, you should assume they are affiliate links or that we benefit in some way.

How Can We Help You? balloons
How Can We Help You?
bullet Custom Programming
bullet Ready-Made Software
bullet Technical Support
bullet Possibilities Newsletter
bullet Website "How-To" Info
bullet Useful Information List

© 1998-2001 William and Mari Bontrager
© 2001-2011 Bontrager Connection, LLC
© 2011-2025 Will Bontrager Software LLC