CSS Opacity

Using the opacity Property

The opacity property sets the opacity level for an element, which affects its transparency. The value ranges from 0 (fully transparent) to 1 (fully opaque).

  • Basic Usage

In this example, the .transparent-box class sets the opacity to 50%, making the element semi-transparent.

Tutorials dojo strip
CSS




Using RGBA Colors for Transparency

RGBA color values are another way to apply transparency. The a in rgba stands for alpha channel, which controls the opacity of the color.

  • Basic Usage

In this example, the .transparent-bg class sets a red background color with 50% transparency.

CSS




CSS Opacity and Transperancy Example Code

CSS




CSS Labs

Tutorials dojo strip