-webkit-text-stroke

A shorthand for setting both the thickness and the color of text outlines in one line. Great for creating 'hollow' or 'ghost' text effects.

It is documented as part of the WebKit Extensions specification.

/* Usage Example */
h1 {
  -webkit-text-stroke: 2px #7c3aed;
  color: transparent;
  font-size: 5rem;
}

/* Global values */
-webkit-text-stroke: inherit;
-webkit-text-stroke: initial;
-webkit-text-stroke: revert;
-webkit-text-stroke: revert-layer;
-webkit-text-stroke: unset;
Widely available Since 2017 96% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2017.

4+
49+
3+
15+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC