The <mark>
tag is used to mark or highlight text.
This element adds importance to a fragment of inline text.
A <mark>
element highlighting a text fragment.
Paul Cézanne was a post-impressionist artist.
<p>Paul Cézanne was a <mark>post-impressionist</mark> artist.</p>
A couple <mark>
tags marking text fragments.
Paul Cézanne was a post-impressionist painter. His work laid the foundations of the transition from the 19th-century conception of artistic endeavor to a new and radically different world of art in the 20th century.
<p style="max-width:550px;">
Paul Cézanne was a <mark>post-impressionist</mark> painter.
His work laid the foundations of the transition from the
19th-century conception of artistic endeavor to a
<mark>new and radically different world</mark> of art
in the 20th century.
</p>
The <mark>
element has no attributes, but it does accept global attributes.
The following are commonly used.
Attribute | Value | Description |
---|---|---|
id | value | Provides the mark element with a unique identifier. |
class | classnames | Assigns one or more classnames to the mark element. |
style | CSS-values | Assigns CSS style values to the mark element. |
For additional global attributes see our global attributes list.
By default, the <mark>
element highlight color is bright yellow.
This color is generally not desirable.
With CSS background-color, the highlight color can be adjusted.
A <mark>
tag with a custom highlight color.
Paul Cézanne was a post-impressionist painter.
<p>
Paul Cézanne was a
<mark style="background-color:lavender;">
post-impressionist
</mark> painter.
</p>
Here is when <mark>
support started for each browser:
Chrome
|
6.0 | Sep 2010 |
Firefox
|
4.0 | Mar 2011 |
IE/Edge
|
9.0 | Mar 2011 |
Opera
|
11.1 | Mar 2011 |
Safari
|
5.0 | Jun 2010 |