A URL fragment is the part after `#`. It points within the current document: `/products/coffee-beans#reviews` identifies the reviews fragment of that page. The path identifies the resource; the query string can hold a shareable variation of its view; the fragment identifies a target inside it. section 10.1.8 section 2.1.2
Use descriptive paths for application routes and the query string for shareable state such as sorting or pagination. Reserve the hash for in-page navigation rather than making `/#/products/42` the primary route. Fragment-based routing complicates server integration and weakens the URL's meaning; descriptive paths are also preferred for discoverability. section 10.1.8 section 10.1.9
Text fragment
`#:~:text=espresso` is a fragment that targets text in a page. The portion after `:~:` is a hash directive. When inspecting such a URL, note that `location.hash` may omit directive content, while `new URL(url).hash` returns the full hash segment. section 10.1.8 section 2.1.2
