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 |
This element only includes the global attributes.
<mark>
element for syntax highlighting; use the <span>
element for this purpose.<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.<p>The <mark> element is used to <mark>highlight</mark> text</p>
The <mark> element is used to highlight text
Specification | Status | Comment |
---|---|---|
WHATWG HTML Living Standard The definition of '<mark>' in that specification. | Living Standard | |
HTML5 The definition of '<mark>' in that specification. | Recommendation |
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | (Yes) | (Yes) | 4.0 (2.0) | 9.0 | 11.0 | (Yes) |
Feature | Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | ? | (Yes) | 4.0 (2.0) | ? | ? | ? |
<a>
, <em>
, <strong>
, <cite>
, <q>
, <dfn>
, <abbr>
, <time>
, <code>
, <var>
, <samp>
, <kbd>
, <sub>
, <sup>
, <i>
, <b>
, <mark>
, <ruby>
, <rp>
, <rt>
, <bdo>
, <span>
, <br>
, <wbr>
.
© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/mark