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.

Subscribe to JEM Newsletter

Stay ahead of the curve in Web Development with Javascript Every Month Newsletter.

I will deliver a curated selection of articles, tutorials, and resources straight to your inbox once a month.

Read the Archives

No spam, unsubscribe anytime.

Keyboard shortcuts

h
Go to Home
b
Go to Blog
w
Go to Webmarks
p
Open Projects
j
Open Newsletter
t
Switch light and dark
s
Turn key sounds on or off
/
Search webmarks
?
Show this sheet

This keyboard hides a couple of secrets. One is spelled out on the home page; the other is older than most of the web.