CSS opacity only to background color, not the text on it?
In CSS, applying the opacity property to an element affects the entire element, including its text and child elements. However, if your goal is to make only the background semi-transparent while keeping the text fully opaque, you need a different approach. The most common and effective method is using RGBA or HSLA…
Answered Sep 23, 2025 · 1.2K Views Read answer →