The HTML <mark> element represents highlighted text, i.e., a run of text marked for reference purpose, due to its relevance in a particular context. For example it can be used in a page showing search results to highlight every instance of the searched-for word.
| Content categories | Flow content, phrasing content, palpable content. |
|---|---|
| Permitted content | Phrasing content. |
| Tag omission | None, both the starting and ending tag are mandatory. |
| Permitted parents | Any element that accepts phrasing content. |
| Permitted ARIA roles | Any |
| DOM interface | HTMLElement |
Attributes
This element only includes the global attributes.
Usage notes
- In a quotation or another block, the highlighted text typically marks text that is referenced outside the quote, or marked for specific scrutiny even though the original author didn't consider it important.
- In the main text, the highlighted text typically marks text that may be of special relevance for the user's current activity, like search results.
- Do not use the
<mark>element for syntax highlighting; use the<span>element for this purpose. - Do not confuse the
<mark>element with the<strong>element. The<strong>element is used to denote spans of text of importance in context of the text, when the<mark>element is used to denote spans of text of relevance to a different context.
Examples
<p>The <mark> element is used to <mark>highlight</mark> text</p>
Result
The <mark> element is used to highlight text
Specifications
| Specification | Status | Comment |
|---|---|---|
| HTML Living Standard The definition of '<mark>' in that specification. |
Living Standard | |
| HTML5 The definition of '<mark>' in that specification. |
Recommendation |
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
| Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|---|
| Basic Support | (Yes) | (Yes) | 4 | 9 | 11 | (Yes) |
| Feature | Android | Chrome for Android | Edge mobile | Firefox for Android | IE mobile | Opera Android | iOS Safari |
|---|---|---|---|---|---|---|---|
| Basic Support | (Yes) | (Yes) | (Yes) | 4 | (Yes) | (Yes) | (Yes) |
See also
Document Tags and Contributors
Tags:
Contributors to this page:
teoli,
Wliu,
sideshowbarker,
erikadoyle,
francoisb,
Sebastianz,
Jeremie,
openjck,
christopherrolfe198,
Stefan1,
kscarfone,
tregagnon,
Sheppy,
medicdude,
ethertank,
lmorchard,
thelonelyghost,
Kissaki,
elzapp,
pgl,
Pbb,
cers,
fscholz,
Yann Dìnendal,
McGurk,
jswisher,
Ms2ger,
sicking
Last updated by:
teoli,

