Date First Published: 22nd January 2024
Topic: Web Design & Development
Subtopic: Web Development
Article Type: Computer Terms & Definitions
Difficulty: MediumDifficulty Level: 5/10
Learn about what the HTML <mark> tag is in this article.
In HTML, the <mark> tag is used to define highlighted text. It was introduced in HTML 5 and is used to quickly make text of interest or relevance stand out to visitors, like terms in search results matching the user's search query and new content. This allows specific sections of text to be picked out for the reader's attention.
By default, text is highlighted in yellow, but the colour can be changed with CSS. This tag is supported by all major web browsers and contains no unique attributes, but supports all global attributes.
Use the <mark> tag to define text that has relevance, not just to highlight large amounts of text, like syntax highlighting. To style large amounts of text to appear highlighted, use a <span> tag with the proper CSS.
The <mark> tag does not have semantic content. To show the importance of the marked text, use the strong or em tags.
The <mark> tag is not to be confused with the strong tag, which is used to indicate text of importance rather than text of relevance.
Below is an example of the mark tag. As seen below, the text between the opening and closing tags is highlighted in yellow. Both opening and closing tags are required.
Highlighted text in a webpage
If so, it is important that you tell me as soon as possible on this page.
Network Services Network Setups Network Standards Network Hardware Network Identifiers Network Software Internet Protocols Internet Organisations Data Transmission Technologies Web Development Web Design Web Advertising Web Applications Web Organisations Web Technologies Web Services SEO Threats To Systems, Data & Information Security Mechanisms & Technologies Computer Hardware Computer Software Ethics & Sustainability Legislation & User Data Protection