The CSS hyphenate-character property lets you define a **custom character** that appears when the browser breaks words using hyphenation. Normally browsers insert β-β automatically, but with this property, you can replace it with any symbol.
Note
β Great for magazines, articles, eBooks, and text-heavy layouts
β Supported in most modern browsers
π¦ Syntax
hyphenate-character syntax
hyphenate-character: "<string>";
/* Examples */
hyphenate-character: "-";
hyphenate-character: "β’";
hyphenate-character: "β";
hyphenate-character: "...";π¨ 1. Basic Example
Basic usage
p {
hyphens: auto;
hyphenate-character: "-";
}Browser will automatically hyphenate long words and use β-β when breaking.
π¨ 2. Using a Custom Hyphen Symbol
Custom hyphen
p {
width: 180px;
hyphens: auto;
hyphenate-character: "β’"; /* bullet hyphen */
}Now long words break using a bullet instead of the default hyphen.
π¨ 3. Using an Arrow as Hyphen
Arrow hyphen
p {
hyphens: auto;
hyphenate-character: "β";
}Useful for decorative or stylized text layouts.
π¨ 4. Multi-character Hyphen
Multiple chars
p {
hyphens: auto;
hyphenate-character: "...";
}When broken, the text inserts "..." instead of a single symbol.
π¨ 5. Using with Hyphenation Language Rules
Hyphenation works best with proper language tags:
lang attribute
p {
hyphens: auto;
hyphenate-character: "-";
}
/* HTML example */
<p lang="en">Long English words will hyphenate based on dictionary rules.</p>π Requirements for Hyphenation to Work
- 1οΈβ£ hyphens: auto must be enabled.
- 2οΈβ£ Language of text must be known (via lang="xx").
- 3οΈβ£ Container must have a width that forces wrapping.
Note
π§ͺ Real-World Use Cases
1οΈβ£ Magazine / Newspaper Layout
Magazine style
.article {
width: 260px;
hyphens: auto;
hyphenate-character: "Β·";
}2οΈβ£ E-book Reading Interface
ebook
.ebook-text {
hyphens: auto;
hyphenate-character: "β"; /* em dash */
}3οΈβ£ Artistic Typography
Fancy text hyphen
.fancy {
hyphens: auto;
hyphenate-character: "β¦";
}β οΈ Common Mistakes
- β Using hyphenate-character without hyphens: auto
- β Not setting a lang attribute β no hyphenation rules
- β Expecting it to work on unbreakable words (like URLs)
- β Using in a container with no wrapping
Note
π₯ Summary
hyphenate-character lets you customize how words look when broken across lines. When combined with hyphens: auto, it becomes a powerful tool for refined typography, especially in reading interfaces, magazines, and artistic designs.
- hyphens: auto β required
- Custom symbol β any character or string
- Language-aware β depends on dictionary rules