A URI fragment is a string of characters that refers to a resource that is under a primary resource identified by a Uniform Resource Identifier (URI). The fragment identifier is intended to point to the resource that is under a primary resource.
Anchor links or jump menu links are links that instantly take you to a specific part of the page. For example, with hardcoded HTML, we can directly send you to the paragraph which describes what is reinforcement learning. Not only this is helpful for the readers, but Google search may also show up to them if they think it is relevant.
Text Fragments, according to W3C “adds support for specifying a text snippet in the URL fragment. When navigating to a URL with such a fragment, the user agent can quickly emphasise and/or bring it to the user’s attention”. For example, we can directly send you to the paragraph’s certain phrase, such as Markov decision process (MDP).
---
For the past few months, Google has been testing Text fragments. If you’re a Chrome user, you might have noticed directly landing to the specific portion of the webpage containing a text fragment and the feature offered by the Chromium browser. However, there is a risk of exposing some data to service providers and others. An attacker can abuse this method.
Should you use this method to hyperlink within your WordPress site? Firstly, read as much technical documentation available, for example this one. Secondly, at least I do not know all the security risks. Thirdly, I do not know the effect of such hyperlink on SEO.
You may use it within WordPress articles for definite need. Instead, try to use hardcoded HTML based anchor links. How to use it without using any plugin is a good question. It is easy.
1 | https://thecustomizewindows.com/2021/02/what-you-can-control-with-a-smartwatch-and-esp32/ |
If I want to highlight and force to navigate to this sentence :
1 | Making a particular Smartwatch work as a proximity switch (with ESP32) opens a wider array of possibilities |
then, as the first step, I will add #:~:text=
at the end of the URL
1 | https://thecustomizewindows.com/2021/02/what-you-can-control-with-a-smartwatch-and-esp32/#:~:text= |
As final step, I will replace the spaces with %20
:
1 | https://thecustomizewindows.com/2021/02/what-you-can-control-with-a-smartwatch-and-esp32/#:~:text=Making%20a%20particular%20Smartwatch%20work%20as%20a%20proximity%20switch%20(with%20ESP32)%20opens%20a%20wider%20array%20of%20possibilities |
By default, browsers use black text on yellow. The user-agent stylesheet contains CSS that is this:
1 2 3 4 | :root::target-text { color: MarkText; background: Mark; } |
We can force to highlight with our preferred color by adding a piece of CSS :
1 2 3 4 | :root::target-text { color: white; background-color: black; } |
Reference can be found here. I guess using the below header :
1 | Document-Policy: force-load-at-top |
opts out from a document being pointed in this method.