Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

html
tag

How to use the HTML mark tag

Educative Answers Team

The mark tag is used in HTML to highlight relevant text within the HTML page. By default, browsers display text within the <mark> tag as black with a yellow background.

The <mark> tag is supported by the following browsers:

widget

Here is the syntax for the <mark> tag:

<p> This text is <mark>very</mark> important</p>

This results in the following output on the browser:

This text is very important.

Remember: The HTML <mark> element can only be used within the <body> tag.

By default, the <mark> tag will set the background color to yellow and the text color to black, but this can be edited within the CSS file:

The change in CSS converts the above example into:

This text is very important.

Bold, italics, and other styles can be added within the CSS file.

RELATED TAGS

html
tag
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring