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

See what can be done with creative use of CSS masking in this smart recreation of the effects in True Detective's title sequence.

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 is digital editor on net magazine.