Direct Technical Answer
In CSS content: "..." properties, Unicode characters are escaped using a backslash followed by 1 to 6 hexadecimal digits representing the code point. If the character is immediately followed by a hex letter (a-f) or digit, you must either write a full 6-digit hex code or place a trailing space delimiter after the escape.
Common CSS Unicode Symbol Escapes
Ready-to-use CSS backslash-hex escapes for frequently used UI icons.
Check Mark
Multiplication X
Right Arrow
Bullet
Black Star
CSS pseudo-element Unicode escaping and trailing space delimiters
/* 1. Basic CSS Unicode hex escapes */
.btn-check::before {
content: "\2713 "; /* \2713 (✓) + space delimiter */
color: #16a34a;
}
.btn-arrow::after {
content: "\2192"; /* → (Right Arrow) */
margin-left: 0.5rem;
}
/* 2. Using unicode-range in @font-face to optimize web font downloading */
@font-face {
font-family: 'SymbolFont';
src: url('/fonts/symbols.woff2') format('woff2');
unicode-range: U+2190-21FF, U+2700-27BF; /* Arrows & Dingbats only */
}
/* Rendered pseudo-elements display ✓ and → */
Common Mistakes vs Production Patterns
Learn which patterns fail in production and the modern standards-compliant alternatives.
Handling Trailing Hex Letters in CSS Escapes
Escapes followed immediately by a-f or numbers./* Want checkmark (2713) followed by letter 'e' */
.item::before {
content: "\2713e"; /* Parsed as 5-digit hex \2713e! */
}
/* Option A: Use space delimiter (space is consumed) */
content: "\2713 e";
/* Option B: Pad to full 6 digits */
content: "\002713e";
Edge Cases & Invariants Matrix
A diverse cross-character test matrix comparing character behavior across ASCII, combining marks, emojis, flags, and surrogate fragments.
| Test Case | Input Glyph | Code Units | Code Points | Graphemes | Category | Technical Explanation |
|---|---|---|---|---|---|---|
| Supplementary Plane Emojis in CSS | 🔥 (U+1F525) |
—
|
—
|
—
|
Standard | Requires 5 hex digits (\1F525). Valid in CSS without surrogate pairs. |
Standards & Source Provenance
All technical invariants, APIs, and behaviors in this guide are verified against official primary specifications.
CSS Fonts Module Level 4
Clause: §4.5 Character range: the unicode-range descriptor