DEV Community

loading...

The HTML <mark> element could help make your text more scannable

Šime Vidas
・1 min read

The HTML <mark> element has several uses (e.g., to bring attention to a particular part of a quotation, or to highlight parts of a document that are matching some search string), but it can also be used more generally to highlight the relevant parts of some text.

When used in the main prose of a document, it indicates a part of the document that has been highlighted due to its likely relevance to the user’s current activity.

This element is widely supported in web browsers, and it is styled with a yellow background, by default.

The default user agent styles for the <mark> element

I use the <mark> element on my website to make it easier for my visitors to quickly identify the key parts of the text while scanning the content of the page. Blogs that tend to include large, monotonous blocks of text (the “wall of text” issue), could also benefit from this element.


This content was originally published on https://webplatform.news.

Discussion (0)