Skip to main content

HTML <mark> Tag

The HTML <mark> tag allows text to be highlighted on a page, making it stand out from other content. It's especially useful for drawing attention to important information or quotes from another part of the page.

To use this tag in your code, simply wrap the text with the tags:

The mark HTML tag is used to highlight text, making it stand out from the rest of the content on a page.

It can be used to emphasize important words or phrases, making them more noticeable and easier to read.

The mark HTML tag is used to <mark>highlight text</mark>, making it stand out from the rest of the content on a page.
It can be used to <mark style="background-color: lime;">emphasize important words or phrases</mark>, making them more noticeable and easier to read.
<mark>This text will be highlighted</mark>

<ul>
  <li>This text will be <mark>highlighted</mark> by using mark tag.</li>
</ul>

<table>
  <tr>
    <th>Name</th>
    <th>Price</th>
  </tr>
  <tr>
    <td>Samsung Galaxy S20</td>
    <td><mark>$1000</mark></td>
  </tr>
</table>

<style>
  .highlight-1 {
    background-color: yellow;
  }
  .highlight-2 {
    background-color: pink;
  }
</style>

<p>
HTML5 is a <mark class="highlight-1">powerful and versatile</mark> markup language used to create interactive web-based content and applications.
Its modern standards make it the ideal choice for developers looking to <mark class="highlight-2">create dynamic, visually appealing experiences online</mark>.
</p>

The HTML <mark> tag can be extremely helpful when it comes to web design and layout. For example, if you have some code that applies throughout a page but needs emphasizing in certain sections, using the mark tag ensures readers won't miss any crucial notes or instructions.

It also makes long sections of text easier to scan, allowing users to quickly find what they are looking for and pick up where they left off without having to read over the entire content again.

Further benefits include increasing accessibility by allowing screen readers to distinguish between important information and all other content on a page, as well as providing subtle visual cues that draw attention to certain elements without overwhelming users with too much color or animation.