A decorative or overlay layer is needed without adding an actual new HTML element to the page.
⚡ Quick Fix (TL;DR)
The Culprit: Adding a real extra div just for a visual effect adds markup that has nothing to do with the actual content.
The Fix: Create a pseudo-element that can serve as an overlay, decorative layer, gradient, or other visual effect – the same underlying technique behind the adjustable-opacity background fix above.
.example::before {
content: "";
position: absolute;
inset: 0;
} Was this helpful? Thanks for the feedback!
Tagged in :
More from the field
Bisect to an Empty Baseline Before Trusting Any Single Theory
.
Multiple plausible-sounding theories for a bug each turned out to be wrong when actually tested – time was spent building fixes…
A Security Dashboard’s Activity Log Can Lag a Full Day Behind Real Time
.
Trying to check a security tool’s activity log for an event that had just happened showed nothing at all.