A semi-transparent dark gradient placed between a background image and foreground text ensures consistent contrast regardless of image content. The overlay gradually darkens the image where text sits, allowing the visual richness of the image to remain visible while text stays legible.
Linear gradients from transparent to semi-opaque black are the most common approach. Multi-layered radial gradients can focus the overlay around text areas. CSS backdrop-filter with brightness and contrast adjustments offers a more dynamic alternative that adapts to varying background content.