Curriculum ▸ HTML Zero → Mastery ▸ Lesson 22: Highlighting Text (<mark>) Foundations

Lesson 22 — Highlighting Text <mark>

Learning Goals

Part 1 — What is <mark>?

The <mark> element highlights text with a default yellow background. It indicates relevance, often used for search terms or to draw attention in notes.

Part 2 — Example

<p>Search results for “HTML”:  
Here is the <mark>HTML</mark> keyword highlighted.</p>

Result: The word “HTML” appears highlighted, drawing the reader’s eye.

Part 3 — Best Practices

Part 4 — Common Mistakes

Quick Quiz

  1. What does <mark> do?
  2. When should you use <mark>?
  3. Why not use it for decoration?
Sample Answers
  • It highlights text with a yellow background.
  • When showing relevance in search results or study notes.
  • Because it has semantic meaning, not just style.

Mini Project — Search Highlight

Write a paragraph of text. Wrap one keyword in <mark> to simulate a search result highlight.

Lesson 22 Dictionary

<mark> (Highlight)
Marks text as relevant by highlighting it, usually with a yellow background. Useful for search results or notes.