Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML <mark> Tag

Improve Article
Save Article
  • Difficulty Level : Basic
  • Last Updated : 19 Jul, 2022
Improve Article
Save Article

The <mark> tag in HTML is used to define the marked text. It is used to highlight the part of the text in a paragraph. The <mark> tag is new in HTML 5.
 

Syntax: 

<mark> Contents... </mark>

Example 1: This example uses <mark> tag to highlight the text. By default, <mark> tag highlight the text content in yellow color.

html




<!DOCTYPE html>
<html>
 
<body>
    <h1 style="color: green;">GeeksforGeeks</h1>
   
    <h2>HTML mark Tag</h2>
 
     
 
<p>
        <mark>GeeksforGeeks:</mark> It is a
        <mark>computer science</mark> portal for geeks
    </p>
 
 
</body>
 
</html>


Output: 
 

Example 2: This example uses <mark> tag with CSS property to change the marked content color and other property. 
 

html




<!DOCTYPE html>
<html>
 
<body>
    <h1>GeeksforGeeks</h1>
   
    <h2> HTML mark Tag</h2>
 
     
     
<p>
        <mark>GeeksforGeeks:</mark> It is a
        <mark style="background-color: green; color: white;">
            computer science
        </mark> portal for geeks
    </p>
 
 
</body>
 
</html>


Output:

Supported Browsers: 

  • Google Chrome 
  • Edge 12.0 and above
  • Internet Explorer 9.0 and above
  • Firefox 4.0 and above
  • Opera 11.0 and above
  • Safari 

 


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!