Articles → HTML → mark tag in HTML

mark tag in HTML






Purpose





Syntax


<mark>text to be highlighted</mark>



Example


<html>
<head>
    <title>mark demo</title>    
</head>
<body>
    Please check with
    <mark>sumit</mark>
    on this.
</body>
</html>



Output


Picture showing the output of mark tag in html

Click to Enlarge


Changing the background and text color




<html>
<head>
    <title>mark demo</title>
    <style type="text/css">
        mark
        {
            background-color: red;
            color: white;
        }
    </style>
</head>
<body>
    Please check with
    <mark>sumit</mark>
    on this.
</body>
</html>




Picture showing the output of mark tag with changed background color

Click to Enlarge


Browser support


Internet ExplorerFirefoxChromeSafariOperaEdge
9.04.06.05.011.1Yes



Posted By  -  Karan Gupta
 
Posted On  -  Monday, October 10, 2016
 
Updated On  -  Friday, September 22, 2017

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250