<mark> : Mark Text element

Introduction


The <mark> element in HTML is used to highlight or mark portions of text within a document. It’s typically used to denote sections of text that are particularly relevant or important, similar to highlighting text with a marker on a printed document.

Here’s a simple example of how the <mark> element can be used:

Output :

In this example:

  • The <p> element contains a sentence of text.
  • When rendered in a browser, the text inside the <mark> element will typically be highlighted, making it stand out from the surrounding text.

The <mark> element is primarily used for styling purposes to visually distinguish specific portions of text. It doesn’t inherently imply any semantic meaning beyond indicating that the marked text is somehow noteworthy.

We can also change the written style and colour of highlighter by CSS.

Leave a Comment