The Wayback Machine - https://web.archive.org/web/20210623230004/https://www.geeksforgeeks.org/how-to-define-marked-highlighted-text-using-html5/
Skip to content
Related Articles

Related Articles

Improve Article
How to define marked/highlighted text using HTML5 ?
  • Last Updated : 22 May, 2020

In the article, we define a marked/highlighted tex 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:




<!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
My Personal Notes arrow_drop_up
Recommended Articles
Page :