Table of contents
- 1. Summary
- 1.1. Usage context
- 1.2. Attributes
- 1.3. DOM Interface
- 1.4. Examples
- 1.4.1. Result
- 1.5. Compatibility
- 1.6. See also
Summary
The HTML Mark Element (<mark>) 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.
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 special importance, when the <mark> element is used to denote spans of text of special relevance.
Usage context
| Permitted content | Phrasing content |
| Tag omission | None, both the start tag and the end tag are mandatory |
| Permitted parent elements | Any element that accepts phrasing content. |
| Normative document | HTML5, section 4.6.17 |
Attributes
This element has no other attributes than the global attributes, common to all elements.
DOM Interface
This element implements the HTMLElement interface.
Examples
<p>The <mark> element is used to <mark>highlight</mark> text</p>
Result
The <mark> element is used to <mark>highlight</mark> text
Compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | (Supported) | 4.0 (2.0) | 9.0 | 11.0 | (Supported) |
| Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | ? | 4.0 (2.0) | ? | ? | ? |

