Home > Web Front-end > CSS Tutorial > Highlighting Text in Links with Text Fragments

Highlighting Text in Links with Text Fragments

Susan Sarandon
Release: 2024-11-24 00:31:09
Original
481 people have browsed it

Highlighting Text in Links with Text Fragments

I’ve used URL text fragments in a few posts now and often use it outside of this blog to point someone to a particular piece of text on a page. They’re a really useful feature that allows you to create a URL that links not just to a page or an anchor on that page, but specifically to a bit of text that you’d like to call out to your audience.

The URL Fragment Text Directive is a W3C Draft, but has been around in at least some major browsers since 2020 and now has good support across Chrome, Edge, Safari, and Firefox as of this September. Firefox was the last straggler, with Safari joining the party in 2022.

Building URLs

Despite using Safari as my daily driver for various privacy, security, performance, and platform integration reasons, I still keep Chrome around for the occasional Google Meet call and for generating these links: highlight some text and right clip to copy a link to the highlight. Safari doesn’t have that feature yet unfortunately.

Read More

The above is the detailed content of Highlighting Text in Links with Text Fragments. For more information, please follow other related articles on the PHP Chinese website!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template