The <mark> element represents a span of text that is highlighted.
<mark> |
Yes | Yes | Yes | Yes | Yes |
The <mark> tag is new in HTML5.
The <mark> tag supports the Global Attributes in HTML.
The <mark> tag supports the Event Attributes in HTML.
mark {
background-color: yellow;
color: black;
}
A demo showing how to use <mark> tag.
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
</head>
<body>
<mark>HTML</mark> is <mark>cool</mark>.
</body>
</html>
<!DOCTYPE HTML>
<html>
<head>
<style>
mark {background-color: #0F0; font-weight:bold;}
</style>
</head>
<body>
<mark>java2s.com</mark>
</body> <!-- w w w. j ava 2 s . co m-->
</html>