🧡 CSS hyphenate-character β€” Complete Tutorial

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.

>>β€œhyphenate-character lets you customize how words visually break β€” giving your typography more personality.”

Note

βœ” Works only when hyphenation is enabled (via hyphens: auto)
βœ” 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

Without these, hyphenate-character has **no effect**.

πŸ§ͺ 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

Hyphenation does **not** work on inline elements like span if the parent width doesn’t force breakage.

πŸ”₯ 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
>>β€œTypography is not just text β€” it’s design. Hyphenate-character helps you control that design.”