It means highlighting an important word in a paragraph or sentence. For example, This is a dangerous place, if you highlight “dangerous” in this sentence, the user will quickly see the highlighting word. And if you have a shopping website, if you highlight all the words like the ‘offer! offer!’, ‘discount’, ‘buy1 get1’, users will see that highlighting a word and read your paragraph completely. This way we can highlight important words. We can highlight the words using paired <mark> tags in HTML and background-color properties in CSS. Let’s see how to do it with an example.
Output:
In the above HTML code, there is some text inside a <p> tag and only the “highlighting” text is inside the <mark> tag. Every word we put in the <mark> tag is highlighted and the default color of the mark tag is yellow. For this, you need to use the background-color property in CSS to change the color. It is one of the easiest ways to highlight the text.
<p>Don't forget to buy
<span style="background-color:yellow">milk</span>today. </p>
Read more>>