Testing

CSS Text Stroke: Browser Support, Syntax, Issues

CSS text stroke works through -webkit-text-stroke in Chrome 4+, Edge 15+, Firefox 49+, Safari 3.1+, Opera 15+, and Samsung Internet 4+. Learn syntax, use cases, issues.

Author

Prince Dewani

May 6, 2026

CSS text stroke is a WebKit-originated CSS property that draws a colored outline along the edges of text characters. It works through the -webkit-text-stroke prefix in Chrome 4+, Edge 15+, Firefox 49+, Safari 3.1+ on macOS, Safari 4+ on iOS, Opera 15+, and Samsung Internet 4+, while Internet Explorer never supported the property.

This guide covers what CSS text stroke is, the browsers that support it, the syntax, the longhand properties, the use cases, and the known issues.

What is CSS text stroke?

CSS text stroke is a CSS property that paints a colored outline along the edges of text characters. It is exposed through the -webkit-text-stroke prefix and is documented in the WHATWG Compatibility Standard. The property is a shorthand for -webkit-text-stroke-width and -webkit-text-stroke-color.

Which browsers does CSS text stroke support?

CSS text stroke has wide modern browser support through the -webkit- prefix on every Chromium-based browser, Firefox, and Safari. Internet Explorer is the only major browser that never shipped the property.

Loading browser compatibility data...

CSS text stroke compatibility in Chrome

Chrome supports -webkit-text-stroke by default from Chrome 4 on Windows, macOS, Linux, ChromeOS, and Android. The property has shipped unchanged since the early Blink fork from WebKit, so every modern Chrome release renders the same stroke width and color across desktop and mobile.

CSS text stroke compatibility in Edge

Microsoft Edge supports -webkit-text-stroke by default from Edge 15 on Windows. Legacy EdgeHTML 12 to 14 did not support the property. Chromium-based Edge from Edge 79 onward inherits the Blink implementation, so the rendered stroke matches Chrome on every platform Edge ships on.

CSS text stroke compatibility in Firefox

Firefox supports -webkit-text-stroke by default from Firefox 49 on Windows, macOS, Linux, and Android. Firefox 48 had it disabled by default behind the layout.css.prefixes.webkit preference, and Firefox 2 to 47 did not support the property. Firefox rounds the stroke corners while WebKit leaves them sharp, so the rendered shape on a heavy stroke can differ between Firefox and Safari.

CSS text stroke compatibility in Safari

Safari supports -webkit-text-stroke by default from Safari 3.1 on macOS and Safari 4 on iOS and iPadOS. WebKit was the first engine to ship the property, and Safari 3.2 on iOS had partial support before the iOS 4 release. Every Safari release on macOS and iOS still uses the same -webkit- prefixed form; there is no non-prefixed Safari path.

CSS text stroke compatibility in Opera

Opera supports -webkit-text-stroke by default from Opera 15 on desktop, which is the first Opera release built on the Blink engine. Presto-era Opera 9 to 12.1 did not support the property. Opera Mobile and Opera for Android share the Chromium codebase, so they inherit the same stroke rendering as Chrome on the matching version.

CSS text stroke compatibility in Samsung Internet

Samsung Internet supports -webkit-text-stroke by default from Samsung Internet 4 on Galaxy phones and tablets. The browser shares its rendering engine with Chrome on Android, so every Chromium-based release inherits the same stroke width handling and the same -webkit-text-fill-color interaction as the matching Chrome version.

CSS text stroke compatibility in Android Browser

Chrome for Android supports -webkit-text-stroke by default on every modern Chrome release, and Android WebView matches the system Chrome version. The legacy Android Browser 2.1 partially supported the property, Android Browser 3 did not support it, and Android Browser 4 onward shipped the WebKit implementation. Devices on Gingerbread through KitKat with the stock browser silently drop the rule.

CSS text stroke compatibility in Internet Explorer

Internet Explorer 5.5 through 11 do not support -webkit-text-stroke. Microsoft has retired Internet Explorer, and Trident never shipped any text-stroke implementation. Pages that must render an outline on IE should fall back to a four-direction text-shadow stack or render the headline as an SVG text element with a stroke attribute.

Note

Note: CSS text stroke renders with sharp corners in WebKit and rounded corners in Firefox, and legacy Android Browser silently drops it. Test it on real browsers and OS with TestMu AI. Try TestMu AI free!

What is the syntax of CSS text stroke?

-webkit-text-stroke is a shorthand that takes a width and a color in either order, separated by a space. The property accepts the global keywords inherit, initial, revert, revert-layer, and unset, and inherits down the cascade like color and font.

  • <length>: Sets the stroke width. Accepts px, em, rem, and other CSS length units. Negative values are invalid. A 0 width disables the stroke without removing the declaration.
  • <color>: Sets the stroke color. Accepts named colors, hex, rgb, rgba, hsl, hsla, oklch, color-mix, and currentColor. Defaults to currentColor when omitted.
  • Order is flexible: -webkit-text-stroke: 2px navy and -webkit-text-stroke: navy 2px both parse to the same shorthand. The width is matched as a length and the color as a color value.
  • Inheritance: The property inherits, so a stroke set on body propagates to every text node unless an inner selector overrides it. Use -webkit-text-stroke: 0 currentColor to reset the stroke on a child.
  • Pairing with -webkit-text-fill-color: Setting -webkit-text-fill-color: transparent on the same element renders a hollow glyph. The fill-color property takes precedence over the standard color property when both are declared.
  • Animation: -webkit-text-stroke-width animates as a length and -webkit-text-stroke-color animates as a color. The shorthand itself does not animate; use the longhand properties when transitioning between states.
/* Solid stroke around filled text */
.headline {
  color: #1f2937;
  -webkit-text-stroke: 2px #f97316;
}

/* Hollow display headline with transparent fill */
.hollow {
  font-size: 6rem;
  font-weight: 800;
  -webkit-text-stroke: 3px #2563eb;
  -webkit-text-fill-color: transparent;
}

/* Feature query gate with text-shadow fallback */
.outline {
  text-shadow:
    -1px -1px 0 #111,
    1px -1px 0 #111,
    -1px 1px 0 #111,
    1px 1px 0 #111;
}
@supports (-webkit-text-stroke: 1px black) {
  .outline {
    text-shadow: none;
    -webkit-text-stroke: 1px #111;
  }
}

What are the longhand properties of CSS text stroke?

-webkit-text-stroke is a shorthand for two longhand properties, and a third related property, -webkit-text-fill-color, controls the glyph interior. All three ship in the same browser versions as the shorthand.

PropertyAcceptsRole
-webkit-text-stroke-width<length> (px, em, rem, thin, medium, thick).Sets the thickness of the stroke around each glyph.
-webkit-text-stroke-color<color> (named, hex, rgb, hsl, oklch, color-mix, currentColor).Sets the stroke paint. Falls back to currentColor when omitted.
-webkit-text-stroke (shorthand)<length> and <color> in any order.Sets width and color in one declaration.
-webkit-text-fill-color<color> including transparent.Overrides the standard color property to control the glyph interior independently of the stroke.
Animatable longhands-webkit-text-stroke-width and -webkit-text-stroke-color.The shorthand itself is not animatable; transition the longhands to animate width and color.
...

What are the use cases of CSS text stroke?

-webkit-text-stroke is most often used as a display-typography effect on hero headlines, where the stroke replaces or layers over the glyph fill. The patterns below all ship to production on landing pages, e-commerce banners, and editorial layouts.

  • Hollow display headlines: Pair -webkit-text-stroke: 3px brand-color with -webkit-text-fill-color: transparent to render an outline-only headline. The pattern is common on fashion, sports, and gaming sites where the headline doubles as a graphic element.
  • Outlined captions over imagery: Apply a thin stroke in a contrasting color to caption text laid on top of a photo or video. The outline preserves legibility when the underlying image varies in brightness, removing the need for a solid text-shadow halo.
  • Brand-color emphasis on inline runs: Wrap a phrase in a span with a brand-color stroke and a transparent fill to highlight a key word inside a paragraph without the visual weight of a bold or color shift.
  • Animated draw-on intros: Transition -webkit-text-stroke-width from 0 to the final width on page load, and pair it with a delayed transition on -webkit-text-fill-color to fade the fill in after the outline draws.
  • Scroll-driven section headers: Use container queries or scroll-linked animations to interpolate -webkit-text-stroke-color between brand colors as the reader scrolls, producing a section divider that responds to position.
  • Print-style numbered headings: Render large editorial numbers (01, 02, 03) with a thick stroke and transparent fill to mimic letterpress chapter markers without loading a custom display font.
...

What are the known issues with CSS text stroke?

-webkit-text-stroke ships in every modern browser, but the way each engine handles the corner shape, the stroke alignment, and the fallback path still trips up production builds.

  • Rounded corners in Firefox: Firefox rounds the stroke corners while WebKit and Blink leave them sharp. A 4px or thicker stroke on a serif font shows the difference clearly between Firefox and Safari. Reduce the stroke width or pick a font with rounder terminals to minimize the gap.
  • No non-prefixed form: The property only ships as -webkit-text-stroke. There is no text-stroke entry in any CSS specification, so the prefix is permanent and a non-prefixed declaration will be ignored by every engine.
  • Stroke is centered on the glyph edge: The browser paints half the stroke outside the glyph and half inside, so a thick stroke eats into the glyph interior. Increase the font-weight or pair the property with -webkit-text-fill-color to compensate when the inner shape collapses.
  • No effect on color fonts and emoji: Color font tables (COLR, CBDT, sbix) ignore -webkit-text-stroke entirely, so an emoji or an icon glyph keeps its bitmap. Apply the property only to text rendered with monochrome outline fonts.
  • Print rendering is inconsistent: Chrome and Safari print -webkit-text-stroke faithfully on macOS, but some Windows print drivers rasterize the stroke at a coarser resolution than the screen render, so a 1px stroke can disappear on print. Use a 2px minimum when the page targets print stylesheets.

In my experience, the failure that bites teams the most is the missing fallback, where a hollow headline with -webkit-text-fill-color: transparent ships without a paired text-shadow path, the QA pipeline tests Chrome and Firefox only, and a user on legacy Android Browser 3 or an old corporate IE 11 sees an invisible headline. Always gate the rule with @supports (-webkit-text-stroke: 1px black) or declare a text-shadow first, then override it inside the @supports block.

Citations

All CSS text stroke version numbers and platform notes in this guide come from these primary sources:

Author

Prince Dewani is a Community Contributor at TestMu AI, where he manages content strategies around software testing, QA, and test automation. He is certified in Selenium, Cypress, Playwright, Appium, Automation Testing, and KaneAI. Prince has also presented academic research at the international conference PBCON-01. He further specializes in on-page SEO, bridging marketing with core testing technologies. On LinkedIn, he is followed by 4,300+ QA engineers, developers, DevOps experts, tech leaders, and AI-focused practitioners in the global testing community.

Open in ChatGPT Icon

Open in ChatGPT

Open in Claude Icon

Open in Claude

Open in Perplexity Icon

Open in Perplexity

Open in Grok Icon

Open in Grok

Open in Gemini AI Icon

Open in Gemini AI

Copied to Clipboard!
...

3000+ Browsers. One Platform.

See exactly how your site performs everywhere.

Try it free
...

Write Tests in Plain English with KaneAI

Create, debug, and evolve tests using natural language.

Try for free

Frequently asked questions

Did you find this page helpful?

More Related Hubs

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests