What characters can be used for up/down triangle (arrow without stem) for display in HTML?
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
Introduction
If you want an up or down arrow without a stem in HTML, the usual answer is to use triangle Unicode characters such as ▲, ▼, ▴, or ▾. Which one you choose depends on size, weight, font support, and whether you want a filled or outline-like appearance.
Common Unicode Triangle Characters
The most useful triangle symbols for UI indicators are these:
- '
▲up-pointing black triangle' - '
▼down-pointing black triangle' - '
▴up-pointing small triangle' - '
▾down-pointing small triangle' - '
△up-pointing white triangle' - '
▽down-pointing white triangle'
You can place them directly in HTML if your file is UTF-8 encoded.
For many interfaces, the small variants ▴ and ▾ look closer to dropdown indicators than the larger filled triangles.
Use Numeric Character References When Needed
If you prefer entity-style insertion, use numeric references.
Numeric references are often safer than relying on named entities because they are explicit and widely supported.
Style the Symbols with CSS
These characters are still text, so font, line height, and vertical alignment affect how they look.
That is usually enough for sort indicators, accordion controls, and menu toggles.
Know When CSS Shapes Are Better
If you need exact size, color, or responsive geometry independent of font rendering, a CSS triangle may be more reliable than a Unicode character.
This avoids font differences across platforms, but it is no longer a text character.
Choose the Symbol Based on the UI Job
For text-heavy controls such as sortable table headers, Unicode triangles are often ideal because they inherit font color and align naturally with text. For icon-like controls where exact geometry matters, CSS shapes or SVG may be the better choice.
There is no single best triangle character for every interface. The correct choice is the one that renders clearly in the font stack you are actually shipping.
Accessibility and Semantics
If the triangle is purely decorative, hide it from assistive technology and put the actual meaning in nearby text or ARIA state. If it indicates sort direction or collapse state, the semantic state should come from the control attributes, not from the symbol alone.
A triangle can reinforce state visually, but it should not be the only source of meaning.
Common Pitfalls
- Picking a Unicode symbol without checking how it renders in the real font stack.
- Relying on named entities when numeric references or direct UTF-8 characters would be clearer.
- Using a decorative triangle as the only indicator of UI state.
- Expecting text symbols to have pixel-perfect geometry across browsers and platforms.
- Reaching for Unicode when CSS or SVG would give more consistent icon control.
Summary
- Common HTML triangle characters include
▲,▼,▴,▾,△, and▽. - Direct UTF-8 characters or numeric references both work well.
- CSS can style text triangles, but font rendering still affects appearance.
- Use CSS triangles or SVG when geometry needs tighter control.
- Treat the symbol as visual support, not as the only source of interface meaning.
Related reading
- What does Html.HiddenFor do?
- What does the "~" (tilde/squiggle/twiddle) CSS selector mean?
- What does the exclamation mark do before the function?
- What happened to --async-stack-traces in node 16 and is there a new alternative?
- What is a callback function?
- What is a clearfix?
- What is a good approach to develop a synchronous/blocking and an asynchrounous/non-blocking library-api in parallel? JavaScript
- What is a SIMPLE implementation of async.series?
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.