How can you highlight text in HTML?

Technology CommunityCategory: HTML5How can you highlight text in HTML?
VietMX Staff asked 3 years ago

If you are working with an HTML5 page, the <mark> tag can be a quick and easy way of highlighting or marking text on a page:

<mark>highlighted text</mark>

To highlight text with just HTML code and support for all browsers, set the background-color style, as shown in the example below, using the HTML tag.

<span style="background-color: #FFFF00">Yellow text.</span>