Interactive online courses HTML Academy
2026-03-09 14:11 Diff

If the shadow has a non-zero feathering radius, then it automatically becomes semi-transparent. But sometimes you need to make a semi-transparent shadow without a feathering radius (such as, for example, for buttons in your mini-browser).

To do this, you can use the new colors format for CSS, rgba. Example:

color: red; color: #ff0000; color: rgba(255, 0, 0, 0.5);

All of the color entries in the example are set to red, but the last entry is set to red with 50% transparency.

In rgba, the first three values specify the color, where they can be any integer between 0 and255. The last value specifies the transparency level and can be a fractional number of between 0 (full transparency) and 1.

You can set a semi-transparent color using rgba not only for shadows, but also for other properties with a color, including: frames, the background, and so on.