Advertisement
❮ Previous: <map> Next: <menu> ❯

<mark>

HTML <mark> (Marked Text) Tag

Example

<p>This is <mark>marked text</mark> was it yellow?</p>

Try this code ❯

Meaning

The <mark> element defines a marked section of text. It should be used in a sense similar to how a highlighter is used on text.

Note: The mark element denotes the relevance of a span of text. By default, most browsers render it in black text on a yellow background, but you can change that with CSS.

To indicate importance, use <strong>; for emphasis, use <em>.

Tip: Don't use <mark> for syntax highlighting purposes; instead, use the <span> element with appropriate CSS applied to it.

Version: HTML5


Standard Syntax

<mark>text</mark>

Browser Support

Status


Advertisement

Global Attributes

<mark> element also supports the Global Attributes in HTML.


Event Attributes

<mark> element also supports the Event Attributes in HTML.


By Default CSS Value(s)

Most of the browsers will display the <mark> element with the following by default value(s)

mark {
  background-color: yellow;
  color: black;
}

Related Tags:

<a>,
<abbr>,
<b>,
<bdi>,
<bdo>,
<br>,
<cite>,
<code>,
<data>,
<dfn>,
<em>,
<i>,
<kbd>,
<q>,
<rp>,
<rt>,
<ruby>,
<s>,
<samp>,
<small>,
<span>,
<strong>,
<sub>,
<sup>,
<time>,
<u>,
<var> and
<wbr>

❮ Previous: <map> Next: <menu> ❯
Advertisement