Skip to main content

How to create a True Detective-style masking effect in CSS

Inspired by the opening titles to the show True Detective, designer Tyler Gaw has demonstrated what can be achieved with CSS masking by creating his own version using images from Flickr Commons.

Gaw particularly liked how the silhouettes of people were used to mask other film shots in the True Detective titles, so he set about recreating this effect. You can read his full account of how he did it here.

CSS masking is a technique that uses one graphical element as a luminance or alpha mask for another graphical element, enabling you to control the transparency of the element being masked. This can be combined with clipping, which defines the visible portion of an element, to create some interesting visual effects.

CSS masking is not widely supported, so this demo only works in Chrome and Mobile Safari. The creator warns that it is "most definitely experimental", and predicts misbehavior such as crashing and animations failing to start.

Tanya Combrinck

Tanya is a writer covering art, design, and visual effects. She has 15 years of experience as a magazine journalist and has written for numerous publications including 3D World, 3D Artist, Computer Arts, net magazine, and Creative Bloq.