Use CSS to highlight text on a page

We can use a span with a specific css class to apply the highlight color. Below, we use the “highlight” class to apply highlighting.


Lorem Ipsum is simply <span class="highlight">dummy text of the printing</span> and typesetting industry.

CSS Class:

  background-color: Yellow;
  color: #B22222;

Lorem Ipsum is simply dummy text of the printing and typesetting industry.

Enjoyed this post? Share it!


Leave a comment

Your email address will not be published.