Opacity and Alpha Colors

suggest change

The standard opacity property is sufficient in modern browsers:

.disabled-preview {
  opacity: 0.6;
}

opacity applies to the element as a whole, including its descendants, and values are clamped to the range from 0 to 1. It also creates a stacking context when the computed value is less than 1.

To make only one color translucent, use an alpha color instead:

.panel {
  background: rgb(20 30 40 / 60%);
}

Do not use Microsoft filter or -ms-filter declarations; they were compatibility mechanisms for obsolete Internet Explorer versions.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents