The <mark> tags can be useful but only for content that you control. If you want to let users make their own highlights, using <mark> can potentially break the markup.
Consider the following markup:
<p>
The <em>lazy dog</em> jumped <b>over the sleeping fox</b>.
</p>
How would you highlight:
"dog jumped over"
You would need three separate <mark> elements to wrap the content. And to change or remove that highlight would require some heavy lifting to preserve the structure of the markup.
While the <mark> tag can be useful - it is very limited for any interactive UIs.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The
<mark>tags can be useful but only for content that you control. If you want to let users make their own highlights, using<mark>can potentially break the markup.Consider the following markup:
How would you highlight:
You would need three separate
<mark>elements to wrap the content. And to change or remove that highlight would require some heavy lifting to preserve the structure of the markup.While the
<mark>tag can be useful - it is very limited for any interactive UIs.