Jeff Bailey
Written by Jeff Bailey
Learning resources, opinions, and facts about technology.

How to highlight text on a web page

Reading Time: 2.8 minutes
Listen to this post

How to highlight text on a web page with a few effortless steps.

Google is working on a web standard for this feature. If it gains traction, you may see this feature in other browsers in the future.

Please note that this feature now exists as a Google Chrome flag. It is unnecessary to install this extension unless you’re using an out-of-date version of Google Chrome.

Edit this setting:

  1. Enter chrome:flags#copy-link-to-text in your browser bar.
  2. Switch the status to enabled.
  3. Profit

Install the Extension

Install the Link to Text Fragment extension in Google Chrome if it is not already installed.

Highlight Text

Navigate to a web page and select the text like this.

What is The Answer to the Ultimate Question of Life, The Univers, and Everything?

Try It Out

Paste the generated URL in your web browser, and you should see the highlighted text.

42

The generated URL looks like this.

https://en.wikipedia.org/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy#42,_or_The_Answer_to_the_Ultimate_Question_of_Life,_The_Universe,_and_Everything:~:text=In%20the%20works%2C%20the%20number%2042,Lost%2C%20Star%20Trek%20and%20The%20X-Files.%5B87%5D%5B88%5D

The browser simply takes the text and highlights it based on the text input.

I’ve wanted a feature like this for quite a white. The main downside, which requires a versioning standard for web documents, is that the highlight is invalidated if the text changes. The upside is that the specification accounts for that and will still jump to the section the content was previously. If the page structure changes, all bets are off, and the feature will not work.

I find the feature useful for linking to text that doesn’t often change if at all.