In URIs, a hash mark # introduces the optional fragment near the end of the URL. The generic RFC 3986 syntax for URIs also allows an optional query part introduced by a question mark ?. In URIs with a query and a fragment, the fragment follows the query. Query parts depend on the URI scheme and are evaluated by the server—e.g., http: supports queries unlike ftp:. Fragments depend on the document MIME type and are evaluated by the client (web browser). Clients are not supposed to send URI fragments to servers when they retrieve a document.
A URI ending with # is permitted by the generic syntax and is a kind of empty fragment. In MIME document types such as text/html or any XML type, empty identifiers to match this syntactically legal construct are not permitted. Web browsers typically display the top of the document for an empty fragment.
The fragment identifier functions differently to the rest of the URI: its processing is exclusively client-sided with no participation from the web server, though the server typically helps to determine the MIME type, and the MIME type determines the processing of fragments. When an agent (such as a web browser) requests a web resource from a web server, the agent sends the URI to the server, but does not send the fragment. Instead, the agent waits for the server to send the resource, and then the agent processes the resource according to the document type and fragment value.
In an HTML web page, the agent will look for an anchor identified with an HTML tag that includes an id= or name= attribute equal to the fragment identifier.
Several proposals have been made for fragment identifiers for use with plain text documents (which cannot store anchor metadata), or to refer to locations within HTML documents in which the author has not used anchor tags:
"RFC 3986 Uniform Resource Identifier (URI): Generic Syntax". Internet Engineering Task Force. January 2005. Retrieved 2012-03-06. https://datatracker.ietf.org/doc/html/rfc3986#section-3.5
"RFC 3986 Uniform Resource Identifier (URI): Generic Syntax". Internet Engineering Task Force. January 2005. Retrieved 2012-03-06. https://datatracker.ietf.org/doc/html/rfc3986#section-3.5
R. Fielding, Ed., Adobe; J. Reschke, Ed., greenbytes (June 2014). "Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing". Internet Engineering Task Force (IETF). Retrieved 2023-12-27. The target URI excludes the reference's fragment component, if any, since fragment identifiers are reserved for client-side processing{{cite web}}: CS1 maint: multiple names: authors list (link) https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.3
"Representation types and fragment identifier semantics". Architecture of the World Wide Web, Volume One. W3C. 2004. Retrieved 2011-07-13. http://www.w3.org/TR/webarch/#media-type-fragid
Coyier, Chris (2012-04-09) [last updated Jan 13, 2022]. "Using The CSS :target Selector". CSS-Tricks. Retrieved 2024-10-07. https://css-tricks.com/css-target/
MDN contributors (2024-08-08). "target". CSS: Cascading Style Sheets. MDN. Retrieved 2024-10-07. {{cite web}}: |last= has generic name (help) https://developer.mozilla.org/en-US/docs/Web/CSS/:target
"Obsolete features". HTML Living Standard. WHATWG. 2024-08-07. Retrieved 2024-08-08. https://html.spec.whatwg.org/multipage/obsolete.html#obsolete-but-conforming-features
"Validity constraint: ID". XML 1.0 (Fifth Edition). W3C. 2008. Retrieved 2011-07-13. http://www.w3.org/TR/REC-xml/#id
"xml:id Version 1.0". W3C. 2005. Retrieved 2011-07-13. http://www.w3.org/TR/xml-id/
Birbeck, Mark; Gylling, Markus; McCarron, Shane; Pemberton, Steven; et al., eds. (2010-12-16) [Copyright © 2001-2010]. "12. XHTML Core Attributes Module : 12.1. Core Attribute Collection" (W3C Editor's Draft, part of W3C Working Group Note). XHTML™ 2.0. World Wide Web Consortium (W3C). Retrieved 2024-10-07. https://www.w3.org/TR/xhtml2/mod-core.html#adef_core_id
Axelsson, Jonny; Epperson, Beth; Ishikawa, Masayasu; McCarron, Shane; Navarro, Ann; Pemberton, Steven, eds. (2003-05-06). "6. XHTML Attribute Collections : 6.1. Core Attribute Collection" (W3C Working Draft). XHTML™ 2.0. World Wide Web Consortium (W3C). Retrieved 2024-10-07. https://www.w3.org/TR/2003/WD-xhtml2-20030506/mod-attribute-collections.html#adef_attribute-collections_id
Daniel, Ron, Jr.; DeRose, Steve; Maler, Eve, eds. (2000-06-07). "XML Pointer Language (XPointer) Version 1.0" (W3C Candidate Recommendation). World Wide Web Consortium (W3C). Retrieved 2024-10-07.{{cite web}}: CS1 maint: multiple names: editors list (link) https://www.w3.org/TR/2000/CR-xptr-20000607
Møller, Anders; Schwartzbach, Michael I. (October 2003) [First published: March 2000]. "XPointer fragment identifiers". XML tutorial : The XML Revolution : Technologies for the future Web. BRICS, Aarhus University. Retrieved 2024-10-07. NOTE: These slides have not been updated since 2003. They have been superseded by the book An Introduction to XML and Web Technologies Addison-Wesley, and the accompanying online material. Please see http://www.brics.dk/ixwt/ for more information. {{cite web}}: External link in |quote= (help) https://cs.au.dk/~amoeller/XML/linking/fragment.html
Dürst, Martin J.; Wilde, Erik (April 2008). URI Fragment Identifiers for the text/plain Media Type (RFC - Proposed Standard). Network Working Group Request for Comments. Internet Engineering Task Force. doi:10.17487/RFC5147. https://datatracker.ietf.org/doc/html/rfc5147
"Issue 77024". Chromium. 2011. Retrieved 2011-07-13. https://code.google.com/p/chromium/issues/detail?id=77024
Hausenblas, Michael; Wilde, Erik; Tennison, Jeni (January 2014). URI Fragment Identifiers for the text/csv Media Type (RFC - Informational). Independent Submission Request for Comments. (Not endorsed by) the Internet Engineering Task Force. doi:10.17487/RFC7111. ISSN 2070-1721. https://datatracker.ietf.org/doc/html/rfc7111
"Media Type Review". W3C Media Fragments Working Group. 2009. Retrieved 2009-04-29. http://www.w3.org/2008/WebVideo/Fragments/wiki/MediaTypeReview
Hausenblas, Michael; Jägenstedt, Philip; Jansen, Jack; Lafon, Yves; Parker, Conrad; Steiner, Thomas (2012-09-25). Troncy, Raphaël; Mannens, Erik; Pfeiffer, Silvia; Van Deursen, Davy (eds.). "Media Fragments URI 1.0 (basic)" (W3C Recommendation). W3C Media Fragments Working Group, World Wide Web Consortium. http://www.w3.org/TR/media-frags/
"New Feature: Link within a Video". 2006-07-19. Retrieved 2011-07-13. http://googlevideo.blogspot.com/2006/07/new-feature-link-within-video_19.html
"Link To The Best Parts In Your Videos". YouTube. 2008-10-30. Retrieved 2011-07-13. http://youtube-global.blogspot.com/2008/10/link-to-best-parts-in-your-videos.html
MDN contributors (2024-07-18). "Location: hash property". Web APIs. MDN. Retrieved 2024-10-07. {{cite web}}: |last= has generic name (help) https://developer.mozilla.org/en-US/docs/Web/API/Location/hash
Link to Specific Content in Gmail, Google Blogoscoped, 2007-11-17 http://blogoscoped.com/archive/2007-11-17-n25.html
Bryan, P (2013-04-02). "RFC 6901 – JavaScript Object Notation (JSON) Pointer". The Internet Society. Retrieved 2022-07-14. https://datatracker.ietf.org/doc/html/rfc6901#section-6
"Parameters for Opening PDF Files – Specifying parameters in a URL" (PDF). Adobe. April 2007. Retrieved 2017-09-20. https://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf#page=7
Taft, E.; Pravetz, J.; Zilles, S.; Masinter, L. (May 2004). "RFC 3778 – The application/pdf Media Type". tools.ietf.org. The Internet Society. doi:10.17487/RFC3778. Retrieved 2017-09-20. https://tools.ietf.org/html/rfc3778#section-3
"Linking – SVG 1.1 (Second Edition)". http://www.w3.org/TR/SVG11/linking.html#SVGFragmentIdentifiers
"Media Fragments URI 1.0 (basic) W3C Recommendation". Retrieved 2012-09-25. http://www.w3.org/TR/media-frags/
"Scroll to Text Fragment". Chrome Platform Status. Google Chrome. Retrieved 2020-05-18. https://chromestatus.com/feature/4733392803332096
Kelly, Gordon. "Google Chrome 80 Released With Controversial Deep Linking Upgrade". Forbes. Retrieved 2020-06-04. https://www.forbes.com/sites/gordonkelly/2020/02/23/google-chrome-80-upgrade-deep-linking-update-chrome-browser/
"Firefox 131.0 Release Notes". mozilla.org. Retrieved 2024-11-12. https://www.mozilla.org/en-US/firefox/131.0/releasenotes/#:~:text=Firefox%20now%20supports%20text%20fragments
"WICG/scroll-to-text-fragment: Proposal to allow specifying a text snippet in a URL fragment". GitHub. WebPlatform.org Incubator Community Group at W3C. Retrieved 2020-05-18. https://github.com/WICG/scroll-to-text-fragment
"Pypi md5 check support". Retrieved 2011-07-13. Pypi has the habit to append an md5 fragment to its egg urls, we'll use it to check the already present distribution files in the cache https://pypi.python.org/pypi/minitage.recipe.egg/1.41#pypi-md5-check-support
"Hash URIs". W3C Blog. 2011-05-12. Retrieved 2011-07-13. https://www.w3.org/blog/2011/hash-uris/
"HTML 5.1 2nd Edition". W3C. 2017. Retrieved 2018-08-03. https://www.w3.org/TR/html51/dom.html#the-id-attribute
"Proposal for making AJAX crawlable". 2009-10-07. Retrieved 2011-07-13. http://googlewebmastercentral.blogspot.com/2009/10/proposal-for-making-ajax-crawlable.html
"(Specifications) Making AJAX Applications Crawlable". Google Inc. Retrieved 2013-05-04. https://developers.google.com/webmasters/ajax-crawling/
"Proposal for making AJAX crawlable". 2009-10-07. Retrieved 2011-07-13. http://googlewebmastercentral.blogspot.com/2009/10/proposal-for-making-ajax-crawlable.html
"Hash URIs". W3C Blog. 2011-05-12. Retrieved 2011-07-13. https://www.w3.org/blog/2011/hash-uris/
"Manipulating the browser history". Mozilla Developer Network. Retrieved 2017-02-23. https://developer.mozilla.org/en-US/docs/Web/API/History_API
"Deprecating our AJAX crawling scheme". Official Google Webmaster Central Blog. Retrieved 2017-02-23. https://webmasters.googleblog.com/2015/10/deprecating-our-ajax-crawling-scheme.html
Fragment Search, gerv.net http://www.gerv.net/software/fragment-search/
Fragment identifiers for plain text files, Erik Wilde and Marcel Baschnagel, Swiss Federal Institute of Technology (ETH Zürich), Proceedings of the sixteenth ACM conference on Hypertext and hypermedia doi:10.1145/1083356.1083398 /wiki/Doi_(identifier)
Text-Search Fragment Identifiers, K. Yee, Network Working Group, Foresight Institute, March 1998 http://zesty.ca/crit/draft-yee-url-textsearch-00.txt
bmcquade; bokan; nburris (2022-03-24). "Feature: Scroll to Text Fragment". Chrome Platform Status. chromium.org. Retrieved 2022-05-03. https://chromestatus.com/feature/4733392803332096
LiveURLs project http://liveurls.mozdev.org/index.html
The technology behind LiveURLs, accessed 2011-03-13 http://liveurls.mozdev.org/tech.html
"Web Marker" Firefox add-on, accessed 2011-03-13 https://addons.mozilla.org/en-us/firefox/addon/web-marker/
"EPUB Canonical Fragment Identifiers 1.1". idpf.org. Retrieved 2020-06-03. http://idpf.org/epub/linking/cfi/epub-cfi.html