Skip to content
Related Articles

Related Articles

HTML <mark> Tag
  • Difficulty Level : Basic
  • Last Updated : 05 Feb, 2021

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 6.0
  • Internet Explorer 9.0
  • Firefox 4.0
  • Opera 11.1
  • Safari 5.0

 

full-stack-img

My Personal Notes arrow_drop_up
Recommended Articles
Page :