Google Chrome: Scroll To Text Fragment

Google Jun 25, 2020

If you are still wondering why some text is being highlighted in yellow when you open a link from Google Search well that's because the new Google Chrome feature called Scroll To Text Fragment.

This feature allows a user or author to link to a specific portion of a page, using a text snippet provided in the URL. When the page is loaded, the browser highlights the text and scrolls it into view.

This is perfect because somehow we always want to point our users in the right direction when they land in our website and this feature is exactly what we need for that job and the syntax to use it is very simple without  JavaScript or any plugin involved.

#Syntax

https://mywebsite.com/page/#:~:text=My%20text

#Compatibility

Unfortunately this isn't very widely supported yet but we hope this could be included in other browsers.

Data on support for the url-scroll-to-text-fragment feature across the major browsers from caniuse.com

#More info

Scroll To Text Fragment - Chrome Platform Status
This feature allows a user or author to link to a specific portion of a page, using a text snippet provided in the URL. When the page is loaded, the browser highlights the text and scrolls it into view. For example, the URL: [https://en.wikipedia.org/wiki/Cat#:~:text=On islands, birds can contrib…

Edgardo

Full-stack web and mobile developer

Buy me a coffee Support me with a Coffee please :)