URL Fragment Text Directives
The URL fragment text directives API allows web apps to interact with text fragments in the URL. Text fragments allow linking directly to a specific portion of text in a web document, without requiring the author to annotate it with an ID, using a particular syntax in the URL fragment.
Interfaces
- FragmentDirective
- : A (currently) empty object. The existence of an object of this type in document.fragmentDirective is used for feature detection.
Extensions to other interfaces
- Document.fragmentDirective
- : A property that returns a
FragmentDirectiveobject for the current document. Currently only used for feature detection.
- : A property that returns a
CSS selectors
- ::target-text
- : Represents the text that has been scrolled to. It allows authors to choose how to highlight that section of text.
Specifications
Browser compatibility
See also
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
