Opacity and Alpha Colors
suggest changeThe 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.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents