HTML4 HTML5
Used to highlight or mark text due to its current relevance or context (e.g., matched keywords in search results or text fragments relevant to a given analysis)[cite: 3]. By default, browsers display text inside this tag with a yellow background[cite: 3].
Both opening and closing tags are mandatory[cite: 3].
Attributes: Universal attributes such as class, id, and style are mainly used[cite: 3].
Code:
The browser will interpret this code as follows:
Search results for query: HTML
The mark tag highlights key text fragments.