Saturday, April 11, 2020

Have you heard about text fragment anchors?

There are always lots of exciting and interesting things happening in the world of web development. One I just heard about is an experimental feature in Chrome that allows you to create links to any point on a page.

If you want the technical details, see this project from the Web Incubator Community Group.

It will work like this.

You include the text you wish to link to at the end of the URL with the special new `#:~:text=` anchor indicator.


Then the first occurrence of that text is highlighted on the page.


This is still an experimental feature and only works in some browsers. You must enable it like this:
In Chrome:

Or in the new Chromium-based version of Microsoft Edge.

Once you've enabled it and restarted your browser: give it a try


FYI. This was brought to my attention because of a project I'm doing relating to inter-document linking.

1 comment:

  1. Hey Matt and thanks for posting!
    It worked for me without explicitly enabling it, on Android phone Chrome.

    ReplyDelete

I get a lot of comment spam :( - moderation may take a while.