HTML mark tag

<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.

Example


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

Specific Uses

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.

Example

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?

 

Email:

Message:

Get the newsletter