Skip to content

TIL - mark

From series - Today I learned. There is a tag in HTML that helps us highlight stuff just using it. And too many times I have used spans with a highlight class, Damn it!

Let's look at what the mark tag brings in and how to use it.

Just embed mark where you want the highlight and you are good to go.

Where do we use this?

  1. Do you want to highlight the most relevant parts of a paragraph? Use mark.
  2. Do you want to highlight the term user searched for? Use mark
  3. Want to try syntax highlighting? Don't do mark, Use a library.
  4. Want to highlight the most important part in a paragraph? Don't use mark, use strong.