TIL: linking directly to web page content
As a follow-up to my post about link rot, I was delighted to learn that it's now possible to link to anywhere on a page.
Text fragments work by appending a special syntax to the end of a URL; just like we used to append the ID after the hash symbol (#
). The browser interprets this part of the URL, searches for the specified text on the page, and then scrolls to and highlights that text if it supports text fragments.
https://alfy.blog/2024/10/19/linking-directly-to-web-page-content.html
Chromium-based browsers allow you to make such links by simply right-clicking highlighted text and clicking on Copy link to highlight
.
Unfortunately Firefox still doesn't support that. It does, however, support opening those links. And we can create those links by hand instead (or use an extension). For example, linking to the beginning of my earlier quote: https://alfy.blog/2024/10/19/linking-directly-to-web-page-content.html#:~:text=Text%20fragments%20work%20by
Comments ()