Linking to text fragments with a bookmarklet
alexwlchan.net·3w·

One of my favourite features added to web browsers in the last few years is text fragments.

Text fragments allow you to link directly to specific text on a web page, and some browsers will highlight the linked text – for example, by scrolling to it, or adding a coloured highlight. This is useful if I’m linking to a long page that doesn’t have linkable headings – I want it to be easy for readers to find the part of the page I was looking for.

Here’s an example of a URL with a text fragment:

https://example.com/#:~:text=illustrative%20examples

But I don’t find the syntax especially intuitive – I can never remember exactly what mix of colons an…

Similar Posts

Loading similar posts...