Frontend.fyi

Recipe

Using CSS masks to fadeout content

Now you see me, now you don't

User avatar

Jeroen Reumkens PRO

CSS-only text marquee

Unlock Playground Access

Playgrounds let you build, test, and share frontend ideas instantly — right in your browser. Access is included in PRO. Just want Playgrounds? Pick a plan below.

Maker

€5,- / month

Unlimited Playgrounds access to build, experiment, and share without limits.

Join for €5 per month

Champion

€10,- / month

All the benefits of Maker, plus you help Frontend.fyi grow and get a Champion badge on your profile.

Join for €10 per month

Cancel anytime — no commitment.
Upgrade to PRO anytime and get a partial refund.We'll credit 100% of your first 3 months and 50% of the rest toward the PRO lifetime price.

Already a member? Login

Combining a linear gradient with a mask image in CSS, results in nice fadeout masks that you can add on top of any element you want.

These masks have a configurable CSS variable --fade-size that you can adjust to make the fadeout effect hide more or less of the content, without changing the class itself.