Problem Statement
What is the purpose of the <mark> tag?
Explanation
The mark tag is used to highlight or mark text for reference purposes. It typically displays text with a yellow background, similar to using a highlighter pen on paper. The mark tag is useful when you want to draw attention to specific parts of text, such as search results or key terms. For example, when showing search results, you can use mark to highlight the searched keywords. This improves user experience by making it easy to spot relevant information. The mark tag is semantic, meaning it has meaning beyond just visual styling. It tells browsers and assistive technologies that this text is marked for reference.
Code Solution
SolutionRead Only
<p>Search results for "HTML":</p> <p><mark>HTML</mark> is the standard markup language.</p> <p>Learn <mark>HTML</mark>, CSS, and JavaScript.</p> <p>This is <mark>highlighted text</mark> for reference.</p>
