HTML/Elements/mark

From W3C Wiki
< HTML‎ | Elements
Revision as of 14:57, 22 July 2011 by Plehegar (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

<mark>

The <mark> element represents a run of text in one document marked or highlighted for reference purposes, due to its relevance in another context.

HTML Attributes

See global attributes.


Examples

Example A

[try it]:

<p lang="en-US">Consider the following quote:</p>
<blockquote lang="en-GB">
  <p>Look around and you will find, no-one's really
  <mark>colour</mark> blind.</p>
</blockquote>
<p lang="en-US">As we can tell from the <em>spelling</em> of the word,
the person writing this quote is clearly not American.</p>

Mark01.png

Example B

Another example of the mark element is highlighting parts of a document that are matching some search string. If someone looked at a document, and the server knew that the user was searching for the word "kitten", then the server might return the document with one paragraph modified as follows [try it]:

<p>I also have some <mark>kitten</mark>s who are visiting me
these days. They're really cute. I think they like my garden! Maybe I
should adopt a <mark>kitten</mark>.</p>

Mark02.png

HTML Reference

The HTML5 specification defines the <mark> element in 4.6.18 The mark element.