Text Content
HTML <mark> element
Highlights content because of its relevance in the current context, such as a search match. The highlight belongs to the current context rather than the original author's emphasis. Ensure contrast when styling the highlight and do not rely on color alone to communicate essential meaning. It accepts global HTML attributes; individual global features may be inapplicable or restricted.
Formal Syntax & Structure
html syntaxhtml
<mark>Relevant text</mark>Return Value
HTMLElement
Content model: Phrasing content, with element-specific restrictions.
Working Example
Example Snippethtml
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <title>HTML example</title> </head> <body> <p> Result: indoor <mark>garden</mark> guide. </p> </body></html>