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


Previous Article
Next Article

Similar Reads

HTML DOM Mark Object
The Mark Object in HTML DOM is used to represent the HTML &lt;mark&gt; element. The Mark Object is new in HTML 5. The &lt;mark&gt; element can be accessed by using the getElementById() method. Syntax: document.getElementById("id") Where id is assigned to the &lt;mark&gt; tag. Note: This tag is not supported by Internet Explorer and earlier versions
2 min read
How to mark abbreviations and make them understandable in HTML ?
In this article, we will learn how to specify a shorter version of the content in HTML. The &lt;abbr&gt; tag (Abbreviation) is used to define the abbreviation or short form of an element. The &lt;abbr&gt; and &lt;acronym&gt; tags are used as shortened versions and used to represent a series of letters. For instance, "HTML" is used as an abbreviatio
2 min read
How to Mark Deleted Text in HTML?
In HTML, you can mark text as deleted to indicate that it has been removed from the document. This is often displayed with a strikethrough effect. There are different methods to mark deleted text in HTML, including using the &lt;del&gt; tag, the &lt;s&gt; tag, and the &lt;strike&gt; tag. Table of Content Using the &lt;del&gt; TagUsing the &lt;s&gt;
2 min read
How to Mark Strikethrough Text in HTML?
Strikethrough Text is a visual formatting style applied to text where a horizontal line is drawn through the characters. For Example - Strikethrough Text. It is commonly used to indicate that the text is no longer valid, deleted, or that there has been a change or correction made to the content. There are several methods to achieve this, including
2 min read
Which tag is used to represent progress of a task in HTML & how is it different from &lt;meter&gt; tag ?
In this article, we will see which tag is used to represent the progress of a task in HTML. To represent the progress of a task, we will use the &lt;progress&gt; tag. This tag is used to represent the progress of a task. It is also defined how much work is done and how much is left. Syntax: &lt;progress attributes...&gt; &lt;/progress&gt; Attribute
2 min read
Is container tag same as the empty tag in HTML? If not, why ?
In this article, we will see the container tag &amp; empty tag in HTML, along with knowing how they're different from each other. The Container tag is not the same as the empty tag &amp; these are two different categories of tags used in HTML. Container tag: This tag contains 3 parts, namely, the opening tag, content that will be displayed in the b
5 min read
Why use Question mark in TypeScript variable ?
Question marks on TypeScript variable are used to mark that variable as an optional variable. If we put the question mark when declaring a variable that variable becomes optional. The optional parameters will have value as undefined when unused. syntax: function A(x?: number) { // Function_body } Below examples illustrate the above approach: Exampl
2 min read
How to find all button inputs and mark them using jQuery ?
jQuery is a small and fast JavaScript library with a motto: "Write Less And Do More". To use JQuery you can either download the jquery library on your local machine or include the jquery library in your HTML code. Keep in mind that before learning JavaScript you have a basic knowledge of HTML, CSS, and JavaScript. Note: In jQuery button is an exten
2 min read
How to find all inputs that are descendants of a form and mark them with a dotted red border in jQuery ?
The task is to find all the inputs that are descendants (child or grandchild) of a form and mark them with a dotted red border using jQuery. Methods and selectors used : parent descendant selector: This selector is used to select all elements that are descendants of a specified element. Syntax: ("parent descendant") css() method: This method is use
2 min read
What purpose does a &lt;script&gt; tag serve inside of a &lt;noscript&gt; tag?
Usage of NoScript tag: The tag defines alternate content that will be displayed if the user has disabled script or browser does not support script. It can be used inside both &lt;head&gt; and &lt;body&gt; tag. Syntax: &lt;noscript&gt; Contents... &lt;/noscript&gt; Example: &lt;html&gt; &lt;head&gt; &lt;title&gt;wbr Tag&lt;/title&gt; &lt;style&gt; b
1 min read