English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag Reference

HTML5: <mark> Tag

The HTML <mark> tag is used to tag or highlight text in an HTML document that is of special interest or relevance. Traditionally, browsers will present the text found within the <mark> tag as text with a yellow background color. This tag is also commonly referred to as the <mark> element.

Online Example

Highlighting some text:

<!doctype html>
<html>
<head>
<meta charset="UTF-8">-8">
<title>HTML</title>5 mark标签的使用(基础教程网 oldtoolbag.com)</mark>/title>
</head>
<body>
<h1>Heading 1</h1>
<p>The Math test is on <mark>Friday</mark>/mark>.</p>
</body>
</html>
Test to see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

Internet Explorer 9+, Firefox, Opera, Chrome, and Safari support the <mark> tag.

Note:Internet Explorer 8 and earlier versions do not support the <mark> tag.

Definition and Usage of Tags

<mark> tag defines marked text.

Please use the <mark> tag when you need to highlight text.

Most browsers will display the <mark> tag with a yellow background color, but you can change this behavior with CSS.
<mark> tag defines related text and is not intended to be used only for applying highlighter style. If you want to style text to highlight it, please use <span> tag and the correct CSS.

HTML 4.01 and HTML5difference between

<mark> is an HTML5 new tags.

global attributes

<mark> tag supports global attributes, see the complete attribute table HTML Global Attributes.

event attributes

<mark> tag supports all HTML Event Attributes.