HTML <mark>
Tag
The <mark>
tag is used to highlight or mark specific text within a document. It is often used to draw attention to important information or to visually separate a specific section of text.
How <mark>
works:
When using the <mark>
tag, the text enclosed within the tag will be displayed with a yellow background by default, making it stand out from the rest of the content on the page.
Main attributes of <mark>
tag:
Attribute | Description |
---|---|
id | Specifies a unique id for the element |
class | Specifies a class for the element |
style | Specifies an inline CSS style for the element |
Example:
<p>This is a paragraph of text with a <mark>highlighted</mark> word.</p>
This is a paragraph of text with a highlighted word.