HTML mark tag

HTML <mark> tag defines the highlighted text. We highlight the text which is most relevant to the user’s current activity. The default background color of the marked text is yellow.

<p>You should <mark>highlight</mark> all those points which are important for the user.</p>
<p><mark>Mark</mark> the important points</p>
</>

You should highlight all those points which are important for the user.

Mark the important points

Tag Uses

Specific uses of <mark> tag

mark element may be used to highlight text for some searching string, to highlight specific parts of coding or to mark text relevant to the exam.

CSS properties may be applied on the mark element.

mark{
	background-color:lightgreen;
	font-size:20px;
}
</style>

Try</>

The default background color is yellow. But it can be changed. All CSS properties can be applied on mark tag.

Tag omission

Both opening and closing tags are necessary for the mark element.

Global Attributes

All the global attributes are applicable on the mark element.



Was this article helpful?