HTML Tag Reference - HTML tag <mark>








The <mark> element represents a span of text that is highlighted.

Browser compatibility

<mark> Yes Yes Yes Yes Yes

What's new in HTML5

The <mark> tag is new in HTML5.

Global Attributes

The <mark> tag supports the Global Attributes in HTML.

Event Attributes

The <mark> tag supports the Event Attributes in HTML.

Default CSS Settings

mark {
    background-color: yellow;
    color: black;
}

Click to view the demo





Example

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>

Click to view the demo





mark with style

<!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>

Click to view the demo