<mark>...</mark>

HTML4 HTML5

Used to highlight or mark text due to its current relevance or context (e.g., matched keywords in search results or text fragments relevant to a given analysis)[cite: 3]. By default, browsers display text inside this tag with a yellow background[cite: 3].

Both opening and closing tags are mandatory[cite: 3].

Attributes: Universal attributes such as class, id, and style are mainly used[cite: 3].

Example

Code:

<p>Search results for query: <mark>HTML</mark></p> <p>The <mark>mark</mark> tag highlights key text fragments.</p>

The browser will interpret this code as follows:

Search results for query: HTML

The mark tag highlights key text fragments.