Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / HTML

mark — contextual highlighting

The mark element identifies contextually relevant text, such as a search match or a passage being discussed in a quotation.

Version: WHATWG HTML Living Standard; index snapshot date recorded separately

Syntax

<mark>text</mark>

mark identifies text relevant in another context: a search match or highlighting added to a quotation by a commentator, not its original author.

This differs from importance (strong) or stress emphasis (em). Prefer span for syntax coloring; do not choose mark solely for appearance.

The element accepts phrasing content and global attributes. Both tags are required. In the example, orbit is highlighted as a search match.

Examples

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Contextual highlight</title>
</head>
<body>
  <p>Search term: orbit</p>
  <p>The satellite entered <mark>orbit</mark>.</p>
</body>
</html>

Result

Search term: orbit

The satellite entered orbit.

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources