X

Headline

This is an important message requiring you to make a choice if you're based in the EU.

HTML <mark> tag

The <mark> tag marks a part of the text which has relevance. It can be used to highlight text for showing emphasis, highlight search terms in search results to provide context; or distinguish new content added by user by showing it differently.

In the Chrome and Firefox the tag content is marked in yellow, but it can be changed with CSS background-color property .

The <mark> tag doesn’t have semantic content. In order to show the importance of the marked text, use the <strong> or <em> tags.

Syntax

The tag content is written between the opening (<mark>) and closing (</mark>) tags.

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
  </head>
  <body>
    <p>Learn HyperText markup language (HTML) on <mark>W3Docs.com</mark> website.</p>
  </body>
</html>

Result

Attributes

The <mark> tag supports the Global attributes and the Event Attributes.


Browser support

6+ 4+ 5+ 11.1+


Do you find this helpful?

Related articles