HTML span (most renderers)
<span style="color:#c2410c">text</span> works in static site generators, Obsidian, VS Code preview and here. Pick colours with enough contrast (at least 4.5:1 against the background, per WCAG).
On GitHub
GitHub removes style attributes, so spans don’t colour. Options that do render:
- Math:
$\color{red}{\textsf{text}}$uses GitHub’s LaTeX support. It’s a hack: it renders as an image-like formula, is not selectable as normal text and may break. - Diff blocks: lines starting with
+are green and-red inside a```diffblock. - Alerts:
> [!NOTE],[!TIP],[!IMPORTANT],[!WARNING],[!CAUTION]give coloured callouts. - Emoji: 🟢 🟡 🔴 for status columns.
Highlight
Some renderers support ==highlight==; everywhere HTML is allowed, <mark>text</mark> works.
Centre text
Same limitation: use <p align="center"> on GitHub or a style elsewhere.