Mark Element in HTML5 | Mark Tags

What is the mark tag in html?

The mark element or mark tag (<mark></mark>) is used to mark or highlight text in an HTML document. It works like as you highlight text in text editors. Mark tag or mark element (<mark></mark>) is an inline tag. Its styles can be changed with the help of CSS (Cascading Style-sheets). To elaborate <mark> tag more see the following code.

Html5 Mark Tag Example:

<!DOCTYPE html>

<html lang='en'>

<head>

<meta charset="UTF-8" />

<title>

HTML Text Mark

</title>

</head>

<body>

<h6>

HTML Text Mark

</h6>

<p>

<mark>

Aliquam posuere nulla

</mark>

quis enim sodales congue. Vivamus tortor mauris,

feugiat semper vehicula non, blandit sed mi. Proin sed urna eu nunc

convallis aliquam.

</p>

</body>

</html>

Output:

HTML Text Mark

Aliquam posuere nulla quis enim sodales congue. Vivamus tortor mauris, feugiat semper vehicula non, blandit sed mi. Proin sed urna eu nunc convallis aliquam.

In the above output we have got the marked or highlighted text in the beginning of the paragraph. It is the place where we have put the <mark></mark> tags. You can see that this mark element or mark tag is an inline element because it is flowing with the text not breaking it. We can change the highlighted text styles with the help of CSS. For example to change the background and the text colors etc. to meet our needs. It is not similar to the <em> or <strong> tags in HTML. It is to help you to modify the presentation of your document.

Comments