Highlighted Text
Highlighter over text—how is the colour kept?
✅ NormativeSettled. The requirement holds as written.📄 Page ruleCan be applied from the page alone.Read §7.2.5 in the RFC ↗
Highlighted text MUST be wrapped in <mark> carrying the highlighter colour as an attribute:
<mark style="background-color: yellow">the highlighted phrase</mark>.
When it applies
Text printed on a highlighter background is content, not decoration. The highlight MUST NOT be dropped, and MUST NOT be reduced to bold or italic.
<mark style="background-color: yellow">the highlighted phrase</mark>
Reading the examples. Each one pairs a source page with the output the rule expects. ✅ Sample: the rule applies. ❌ Counter-sample: it looks like it applies and does not, or a rendering got it wrong. A non-conforming output, in red, is shown only for contrast. … marks content left out of an excerpt.
The point, in a small example
The source shows the printed appearance; the output shows the precise markup required by this convention. These pages are made up to isolate the rule.
A yellow highlight has its own markup
Preserve the yellow background as a highlight; it does not imply bold or meaningful yellow text.
Source page
Non-conforming output
What the rule rules out.
Bring **photo ID** tomorrow.Expected output
Bring <mark style="background-color: yellow">photo ID</mark> tomorrow.Requirements
- The colour MUST be named with the nearest HTML colour name —
yellow,green,cyan,magenta,lightgray— not a hex value or an invented label. That keeps the vocabulary finite and matches the treatment of colour in Text Colors (§7.3.12) and Color as the Value (§9.6.4). - The
<mark>MUST cover exactly the run of text that carries the background. If the highlight stops mid-sentence, so does the<mark>. - Inside a table, only the cells whose background is actually coloured are marked; a whole row or column MUST NOT be marked because part of it is highlighted — the same over-application problem as Bold and Italic Inside Tables (§9.6.2).
Why keep the colour
In a reviewed document, different highlight colours usually mean different things — one reviewer
per colour, or one category per colour. A bare <mark> collapses that distinction and there is no
way to recover it afterwards.
Neighbouring rules, and how they differ
More
Rule id text-highlighted-text · text formatting color