Preskočiť na hlavný obsah

What the hell is this? #:~:




 Have you ever seen (as a part of a URL) something like this?

#:~:

Well, that's something! This part of url is called URL Text Fragments. And it is very useful!

How It Works?


You certainly already know that, the # symbol (called a hash or fragment identifier) separates the main URL from a fragment that references a specific section of the page. Traditionally, # links to an element with a matching id attribute.

URL Text Fragments syntax starts with the fragment directive :~: followed by text= and the text you want to highlight.

The #:~:text=MyText syntax enables you to link directly to specific text on a web page without requiring the page author to add an ID. When someone clicks your link, the modern browsers automatically scroll to and highlight the target MyText, making it instantly visible.

The basic format looks like this:

https://example.com/article#:~:text=Your%20Target%20Text

For text ranges, you can specify start and end points:
https://example.com/article#:~:text=start text,end text

Notes

Browser Support: URL text fragment support is extensive in modern browsers like Chrome (81+), Edge (83+), Safari (18.4+), and recent versions of Firefox, but varies in older and less common browsers.
URL Encoding: Special characters need to be URL-encoded (spaces become %20 and so on...)
Case Insensitive: Text matching is not case-sensitive
Privacy: Use rel="noopener" when linking externally
No Page Modifications Needed: Of course, works on any existing page without code changes


Conclusion

URL Text fragments enable deep linking by letting you reference any content on the web, even when you don't control the page structure.

Now, just try it on areal page... https://www.literama.sk/sk/knihy/582618/rozsudok-smrti-s-podpisom-a-venovanim-od-autora#:~:text=Julo,hlavy

Have HTML fun!

Obľúbené príspevky z tohto blogu

mysql 5.0 upgrade to 5.1

The 5.1 series of MySQLwas unmasked for the gentoo portage. When upgrading from an older major version (including 5.0), you will be required to rebuild everything linked to the libmysqlclient.so.15 and libmysqlclient_r.so.15. You can do this by installing app-portage/gentoolkit and running: # revdep-rebuild --library libmysqlclient.so.15 # revdep-rebuild --library libmysqlclient_r.so.15 If you use the Portage 2.2 series, you may also use: # emerge @preserved-rebuild The official upgrade documentation is available here: http://dev.mysql.com/doc/refman/5.1/en/upgrading.html Note that existing databases may need converting as well, again including those upgrading from 5.0 to 5.1.