Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

html

What is mark element in HTML?

Dian Us Suqlain

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

The mark element defines the text that is marked or highlighted in an HTML document.

We can use the mark element with the blockquoteWe use the blockquote element in an HTML document while defining something that already belongs to another source. element to highlight the quoted text. This makes the quoted text even more meaningful to the user.

Syntax

Like other HTML tags, a mark element must be inside tags (<>): <mark>. We use this tag in headings or paragraphs to emphasize essential details and grab the reader’s attention.

how <mark> tag works

Code

Example 01

Observe the following example where the <mark> element highlights only the necessary detail inside the paragraph tag - <p>.

Note: The default color for the highlighted text inside the <mark> tag is yellow.

HTML <mark> element

Example 02

The following example uses CSSCascading Style Sheets to implement an HTML document with the <mark> tag, which changes the look of the marked content.

Using <mark> tag with CSS

RELATED TAGS

html

CONTRIBUTOR

Dian Us Suqlain
Copyright ©2022 Educative, Inc. All rights reserved

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring