Text fragments are a thing

Something I learned about recently is Text Fragments so you can link to a page and tell the browser to scroll to and highlight a specific bit of text, bused on the URL.

The syntax is like this: https://example.com#:~:text=text to link to

For example, this link goes to the MDN site for Text Fragments, and highlights a bit of text in the first paragraph (until they edit that text)

It’s cool because I can link directly to something without needing the website author to provide an in page anchor or ID.

4 Likes