Skip to content

<mark> - The Mark Text Element

Inline HTML5

The mark text element represents text that is marked or highlighted for reference or notation purposes due to its relevance in a particular context.

Result
<mark>highlighted text</mark>

The <mark> element is typically rendered with a yellow background, like a highlighter pen.

Result
Result
Result
Result
Result
Result

Use <mark> for:

  • Search result highlighting
  • Current match in a search
  • Referenced portions in quotes
  • Relevant passages for the current context
  • Highlighted annotations
<!-- Contextual relevance/highlighting -->
<p>Search: <mark>HTML</mark></p>

Customize the highlight appearance:

Result
Result
Result
Result
Result
Result
Result
Result

Most screen readers don’t announce <mark> differently from regular text. The highlighting is primarily visual.

For important highlights, provide textual context:

<p><mark>$99.99</mark></p>

For search highlighting, consider ARIA attributes:

<p aria-label="Search result: HTML elements">
Results for <mark>HTML elements</mark>
</p>

Too many highlights lose impact:

<p><mark>This</mark> is <mark>very</mark> <mark>important</mark> <mark>information</mark>.</p>

Using JavaScript to highlight search terms:

Result
BrowserVersionNotes
Chrome7+Full support
Firefox4+Full support
Safari5.1+Full support
Edge79+Full support
IE9+Full support

The <mark> element is an HTML5 feature with excellent browser support.