Opacity composites an element and its descendants together. Text inside a translucent panel will fade along with its background.
Worked example
<style>
.demo {
opacity: 0.55;
}
</style>
<div class="demo">Apply transparency to the whole element</div>Implementation notes
Lowering foreground opacity is a poor substitute for an appropriately chosen muted text colour. The effective contrast changes with whatever sits beneath the element.
Try it yourself
Place the same white text over an opaque child inside the faded parent.
Open the CSS example →Editorial date February 2, 2026 · Published December 6, 2026