Open In App

How to define marked/highlighted text using HTML5 ?

Improve
Improve
Like Article
Like
Save
Share
Report

In the article, we define a marked/highlighted text by using 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> 

Examples: 

html




<!DOCTYPE html>
<html>
    <head>
        <title>How to define marked/highlighted text</title>
         
        <style>
            body {
                text-align:center;
            }
            h1 {
                color:green;
            }
        </style>
    </head>
    <body>
        <h1>GeeksforGeeks</h1>
        <h2><mark>HTML5: How to define marked/highlighted text
</mark></h2>
         
        <p>
            <mark>GeeksforGeeks:</mark>
            It is a
            <mark>computer science</mark>
            portal for geeks
        </p>
    </body>
</html>


Output: Supported Browsers are listed below: 

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

Last Updated : 30 May, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads