<mark> Tag in HTML

The <mark> tag is used to highlight or mark a specific portion of text in a document. The text enclosed within the <mark> tag is typically rendered with a yellow background, indicating that it is important or has been highlighted for attention.

Key Points on <mark> Tag:

Syntax of <mark> Tag:

Syntax Example

<mark>...</mark>

Examples of <mark> Tag Usage:

1. Simple Highlighting of Text

Code Example

<p>The <mark>quick  </mark> brown fox jumped over the lazy dog.</p>

Output:

The quick brown fox jumped over the lazy dog.

2. Highlighting Multiple Words

Code Example

<p>Learn <mark>HTML, CSS, and JavaScript </mark>for web development.</p>

Output:

Learn HTML, CSS and JavaScript for web development.

Attributes of <mark> Tag:

The <mark> tag is an essential part of HTML for visually emphasizing parts of text that are crucial for the reader. It is commonly used for highlighting search results, key information, or important terms within text paragraphs.