There is no way (what I know) to do this using pure HTML and CSS. You will need to use JavaScript.
Option 1 Use an existing jQuery plugin. A quick search led me to this and an updated plugin here .
Option 2 Throw yours. You would like to use the search () function to find the location of words, and then add span wrappers around the words.
<style>.highlighted{background-color:yellow;}</style> ... <span class="highlighted>HIGHLIGHT ME</span>
The only real advantage of this is that you can use regular expressions to provide more flexibility in what you highlight. It also allows you to avoid jQuery if it is not your cup of tea.
source share