CKTIS / CSS
text-shadow — text shadows
The text-shadow property adds shadows to glyph shapes and text decorations rather than the element’s rectangular box. It supports offsets, blur, color, and multiple layers; it is inherited and does not change layout.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
text-shadow: none | [ <color>? && [ <length>{2} <length [0,∞]>? ] ]#; /* Level 3 subset; Level 4 draft additionally defines spread and inset. */text-shadow creates shadows of text and its decorations, such as underlines. Its initial value is none, and the property is inherited. Setting none on a descendant removes its inherited shadows. Unlike box-shadow, the effect follows glyph shapes rather than the element’s box.
In the Level 3 subset shown here, each shadow requires two lengths: horizontal and vertical offsets. Positive values move the shadow right and down; negative values move it left and up. An optional third length is a nonnegative blur radius; its default of 0 produces a sharp edge. Color may precede or follow the lengths; when omitted, it corresponds to currentColor. Percentages are not allowed.
Separate shadows with commas; the first is above the others, but in this subset all are behind the text. Shadows neither change layout nor enlarge the scrollable area. In the example, Shadow has two sharp, colored shadows, while Plain disables the inherited effect.
Specification boundary: the Level 4 draft additionally defines spread and inset; Level 3 does not allow them. Their presence in the draft does not confirm Chromium 152 support. The example deliberately avoids them and still requires local verification.
Examples
<!doctype html>
<meta charset="utf-8">
<title>text-shadow</title>
<style>
body { background: white; }
.sample {
color: black;
font: bold 48px/1.5 monospace;
text-shadow: 3px 2px 0 #b00020, -3px -2px 0 #005fcc;
}
.plain { text-shadow: none; }
</style>
<p class="sample">Shadow <span class="plain">Plain</span></p>Result
Shadow: black text with a sharp #b00020 shadow offset 3px right and 2px down, and a sharp #005fcc shadow offset 3px left and 2px up. Plain: black text without shadows.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.