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 {{HTMLElement("span")}} element for this purpose. - Do not confuse the
<mark>
element with the {{HTMLElement("strong")}} element. The {{HTMLElement("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.
Content categories | Flow content, phrasing content, palpable content. |
---|---|
Permitted content | Phrasing content. |
Tag omission | {{no_tag_omission}} |
Permitted parent elements | Any element that accepts phrasing content. |
DOM interface | {{domxref("HTMLElement")}} |
Attributes
This element only includes the global attributes.
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 |
---|---|---|
{{SpecName('HTML WHATWG', 'text-level-semantics.html#the-mark-element', '<mark>')}} | {{Spec2('HTML WHATWG')}} | |
{{SpecName('HTML5 W3C', 'text-level-semantics.html#the-mark-element', '<mark>')}} | {{Spec2('HTML5 W3C')}} |
Browser compatibility
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatGeckoDesktop("2.0")}} | 9.0 | 11.0 | {{CompatVersionUnknown}} |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{CompatUnknown}} | {{CompatGeckoMobile("2.0")}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
See also
- Other text-level semantics elements: {{HTMLElement("a")}}, {{HTMLElement("em")}}, {{HTMLElement("strong")}}, {{HTMLElement("cite")}}, {{HTMLElement("q")}}, {{HTMLElement("dfn")}}, {{HTMLElement("abbr")}}, {{HTMLElement("time")}}, {{HTMLElement("code")}}, {{HTMLElement("var")}}, {{HTMLElement("samp")}}, {{HTMLElement("kbd")}}, {{HTMLElement("sub")}}, {{HTMLElement("sup")}}, {{HTMLElement("i")}}, {{HTMLElement("b")}}, {{HTMLElement("mark")}}, {{HTMLElement("ruby")}}, {{HTMLElement("rp")}}, {{HTMLElement("rt")}}, {{HTMLElement("bdo")}}, {{HTMLElement("span")}}, {{HTMLElement("br")}}, {{HTMLElement("wbr")}}.
{{HTMLRef}}