Three ways to write an arrow in HTML
- Paste the arrow directly:
Next →. This works as long as your page uses UTF-8 (<meta charset="UTF-8">). - Named entity:
→for →. Easy to read in code. - Numeric code:
→(decimal) or→(hex). Works for every arrow, even ones without a name.
Named arrow entities
| Arrow | Entity | Decimal |
|---|---|---|
| ← | ← | ← |
| ↑ | ↑ | ↑ |
| → | → | → |
| ↓ | ↓ | ↓ |
| ↔ | ↔ | ↔ |
| ⇐ | ⇐ | ⇐ |
| ⇒ | ⇒ | ⇒ |
| ⇔ | ⇔ | ⇔ |
| ↵ | ↵ | ↵ |
| » | » | » |
Arrows with CSS
Add an arrow after a link without changing the HTML, using the hex code with a backslash:
.more::after {
content: " \2192";
}
You can rotate one arrow instead of using four: transform: rotate(90deg) turns → into ↓.
Arrows in JavaScript
const next = "\u2192"; // →
const emoji = "\u{1F449}"; // 👉
el.textContent = "Next " + next;
Accessibility
Screen readers may read arrows aloud, like “rightwards arrow”. When an arrow is only decoration, wrap it: <span aria-hidden="true">→</span>. If the arrow is the only content of a button, add a label: <button aria-label="Next">→</button>.
