Open In App

HTML <mark> Tag

Last Updated : 12 Jan, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

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>

Note: The <mark> tag also supports the Global Attributes and Event Attributes in HTML.

Example 1:

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:

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 7
  • Edge 12.0
  • Firefox 4.0
  • Opera 11.0
  • Safari 5.1


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads