HTML <mark> Tag Definition, Usage and Examples

The <mark> HTML Tag specifies a piece of the text that has been marked or emphasized for the purpose of reference because it is relevant in another context. In HTML5, this tag was introduced as a new addition. The text contained within the <mark> HTML Tag is rendered with a yellow background in the majority of browsers. However, this can be modified utilizing the CSS background-color property. Text highlights are created using the HTML <mark> HTML Tag, which helps the user distinguish between important sections of the document. The <mark> HTML Tag is part of the Formatting HTML category in HTML Element Reference. The attributes of the <mark> HTML Tag are global and event attributes. 

<mark> code block example to learn how it works is given below.

<mark>Put the text here...</mark>

The second example usage of the “<mark>” code block example is given below.

<p>"The despair of not being able to pay bills, the dread of being rejected, the worry of not getting enough funds, and the anxiety of having to start over is what keeps the majority of people employed. That is the cost of studying to become qualified in a job role or trade and then earning a living. <mark>The majority of people become slaves to money</mark> and then become enraged at their employers."</p>
<cite>Robert Kiyosaki</cite>

What is <mark> HTML Tag?

The <mark> HTML Tag element signifies text that has been marked or highlighted for the purpose of reference or marking, due to the significance or relevance of the marked piece in the surrounding context. In <mark> HTML Tag is used to identify the text that is being marked. It is employed to draw attention to a specific section of text inside a paragraph. The <mark> HTML Tag can be used in two different ways. Intended to draw interest to an area of text that may have been overlooked by the article’s creator but is now receiving more attention than ever before, it is utilized in a citation or other block of the paragraph that has been alluded to from the prose.

How to Use <mark> HTML Tag?

To use the <mark> HTML Tag, the web developer should write the <mark></mark> with text that is being highlighted placed between the start and end tags. Although the tag lacks local attributes, it can be used with any of the global or event content attributes.

Example Usage of <mark> HTML Tag?

The following examples of usage of <mark> HTML Tag are given below.  

<p>"After meeting Juliet in the street, Romeo falls <mark>head-over-heels</mark> whom was destined to marry her father's choice, the County Paris."</p>
<cite>William Shakespear</cite>
<p>"The Merchant of Venice is a destitute Venetian who is trying to<mark>seduce</mark> the lovely Portia, who is his only love."</p>
<cite>William Shakespeare</cite>

What are the Attributes of <mark> HTML Tag?

There are multiple attributes for the <mark> HTML Tag. The following attributes are listed below.

  • Global Attributes: The <mark> HTML Tag supports the global attributes. All HTML elements, even those not specified in the standard, can have global attributes. This means that any non-standard elements must nevertheless allow certain characteristics, even if using such elements makes the content non-HTML5 compliant.
  • Event Attributes: The <mark> HTML Tag supports the event attributes. The Event Attributes always have a name that begins with “on” and is followed by the name of the event for which it is intended. They specify a script to run when an event of the defined type is dispatched to the element with the specified attributes.

What is the Default CSS Setting for <mark> HTML Tag?

The following is the Default CSS Setting for the <mark> HTML Tag. 

mark {

}

What are the Related other HTML Tags to <mark>?

The other related HTML Tags to the <mark> HTML Tag are listed below.

  • <bdi> HTML Tag: The <bdi> HTML Tag and <mark> HTML Tag are related because they are both formatting HTML Tags.The <bdi> HTML Tag separates a section of text from the rest so that it can be formatted differently.
  • <u> HTML Tag: The <u> HTML Tag and <mark> HTML Tag are related because they are both formatting HTML Tag. The <u> HTML Tags specifies that some text is not articulated and is formatted differently from typical text.
  • <template> HTML Tag: The <template> HTML Tag and <mark> HTML Tag are related because they are both formatting HTML Tags. The <template> HTML Tag specifies that when the page loads, the container defines what content should be hidden.
  • <samp> HTML Tag: The <samp> HTML Tag and <mark> HTML Tag are related because they are both formatting HTML Tags. The <samp> HTML Tag defines  a computer program’s sample output. 
Holistic SEO
Follow SEO

Leave a Comment

HTML <mark> Tag Definition, Usage and Examples

by Holistic SEO time to read: 4 min
0