← Back to all elements

The <mark> Element

The <mark> element is used for semantic highlighting of text, indicating that the text is relevant or important, such as search term matches. It provides meaning to assistive technologies, unlike a plain <span>.

When to use it

Use the <mark> element to highlight search terms or important text in documentation, search results, or knowledge bases.

It is especially useful for accessibility, as screen readers can announce that text is highlighted.

Customize its appearance with CSS or Tailwind classes for a better user experience.

Live Demo & Code