mark element

If you don't know what an element is or how you must use it, I recommend you read the "HTML tags and attributes" tutorial that you can find in the HTML tutorials section.

Description

The mark element represents a piece of text marked or highlighted to which authors can refer from another context, to analize or make explanations about it. This element can be usually found wrapping areas of text the author wants to talk about or which are relevant to the user's current activity.

The mark element is particularly useful for marking spans of text in a quotation (blockquote) with the purpose of making reference to them from the current document.

Examples

In our first example a span of text is being highlighted with mark, so the author can make some notes about it in the following paragraph.

<p>Then it goes on:</p>
<blockquote>They were. The engineer and Pencroft, <mark>each armed with a double-barreled gun</mark>, and Gideon Spilett carrying his rifle, had nothing to do but start.</blockquote>
<p>And it's already clear they where expecting nothing but trouble...</p>

Then it goes on:

They were. The engineer and Pencroft, each armed with a double-barreled gun, and Gideon Spilett carrying his rifle, had nothing to do but start.

And it's already clear they where expecting nothing but trouble...

In the second example, a fragment of code is being highlighted with mark to point out a syntax error.

<p>Here's the function as it was before fixing it. You can see the error for yourself: the actual name of the function is "setColor".</p>
<pre><code>function paint(color) {
  <mark>color</mark>(color);
  fillBackground();
}
</code></pre>

Here's the function as it was before fixing it. You can see the error for yourself: the actual name of the function is "setColor".

function paint(color) {
  color(color);
  fillBackground();
}

Lastly, we'll see an example that shows the results of a search. Here the searched term and its variations have been hightlighted for their relevance to the user's current activity.

<p>A <mark>star</mark> is a massive, luminous sphere of plasma held together by its own gravity. The nearest <mark>star</mark> to Earth is the Sun, which is the source of most of the planet's energy. Some other <mark>stars</mark> are visible from Earth during the night, appearing as a multitude of fixed luminous points due to their immense distance. Historically, the most prominent <mark>stars</mark> were grouped into constellations and asterisms, and the brightest <mark>stars</mark> gained proper names. Extensive catalogues of <mark>stars</mark> have been assembled by astronomers, which provide standardized <mark>star</mark> designations...</p>

A star is a massive, luminous sphere of plasma held together by its own gravity. The nearest star to Earth is the Sun, which is the source of most of the planet's energy. Some other stars are visible from Earth during the night, appearing as a multitude of fixed luminous points due to their immense distance. Historically, the most prominent stars were grouped into constellations and asterisms, and the brightest stars gained proper names. Extensive catalogues of stars have been assembled by astronomers, which provide standardized star designations...

Attributes

Global attributes

For information about global attributes refer to this list of global attributes in HTML5.

Events

Global events

For information about global events refer to this list of global events in HTML5.