How to link to specific text on a web page

0

Sharing links has allowed us to find relevant information faster than ever, but it’s hard to do that with text-heavy web pages. Finding useful data requires scanning the entire text, which is tedious and time-consuming. However, using your web browser to create pre-programmed links to highlighted text will allow you to share relevant information with others.

This guide will discuss creating a direct scrolling link to text on multiple web browsers using a PC or Mac.

Link to specific text on a web page on a PC

If you’re a PC user, there are two ways you can create links that direct your recipient to a specific sentence or paragraph on a webpage. You can either create shareable bookmarks or use an extension for your favorite browser.

Create bookmarks

Bookmarks containing small portions of JavaScript code are called bookmarklets. When you click on a specific bookmark link, it will perform a predefined action. If used to direct users to specific webpage sections, the bookmarklet will open the website and focus on the highlighted text box. This feature works on Chrome-based browsers such as Google Chrome and Microsoft Edge.

Creating a clickable bookmarklet on Google Chrome is a relatively simple process. Do this:

  1. Hold “Ctrl + Shift + B” to activate your browser’s bookmark or favorite tab.
  2. Press “Ctrl+Shift+O” to access Chrome’s “Bookmarks Manager”. You can also select “Settings”, tap “Bookmarks” and tap “Bookmarks Manager”.

  3. Once in the “Bookmarks Manager” section, right-click and choose the “Add New Bookmark” option.
  4. Paste the following line of code into the popup URL field:
    “javascript:(function(){const selectedText=getSelection().toString();const newUrl=new URL(location);newUrl.hash=`:~:text=${encodeURIComponent(selectedText)}`;window.open(newUrl);})();”
  5. Rename the bookmarklet. Use the name “Share with a friend” or a similar variation and press the “Save” button.

When you have created your bookmarklet, you can use it to jump directly to a specific part of a website. Here’s how it works:

  1. Launch a web page, select part of its text using the cursor and press the “Share with a friend” bookmark.
  2. The action will generate a new window and the selected text will be highlighted in yellow.
  3. Copy the link.

Once someone clicks on this personalized link, the webpage will automatically scroll to the highlighted section of text. Only users using the Google Chrome or Microsoft Edge browser will be able to click on your link.

It is also possible to create bookmarklets in the latest version of Microsoft Edge. Do this:

  1. Hold “Ctrl + Shift + O” to access the “Manage Favorites” tab. You can also open the “Edge Menu”, select “Favorites” and press “Manage Favorites”.
  2. Go to the “Favorites” section and right-click.
  3. Choose “Add Favorite”.
  4. Enter the following JavaScript snippet in the Contextual URL field:
     “javascript:(function(){const selectedText=getSelection().toString();const newUrl=new URL(location);newUrl.hash=`:~:text=${encodeURIComponent(selectedText)}`;window.open(newUrl);})();”
  5. Change the name of the bookmarklet to “Share with a friend”.

To use the bookmarklet to scroll to specific text in Microsoft Edge:

  1. Open a webpage and select a piece of text with your cursor.
  2. Tap the “Share with a friend” bookmark.
  3. A new window will appear, highlighting the selected text in yellow.
  4. Copy the window URL from the address bar.

When you send the link to other people, they will be taken directly to the part of the web page where the highlighted text is. Only Chrome and Edge users will be able to use the bookmarklet link.

Using the Text Fragment Link Extension

If you don’t want to create links manually, extensions like Link to Text Fragments are another great option. It creates a pre-programmed hyperlink that directs users to selected words, phrases, and paragraphs on a web page.

To use the extension in Google Chrome:

  1. Install the extension from the Google Store.
  2. Press the “Add to Chrome” button.
  3. A pop-up message will ask you to confirm the action. Tap “Add extension”.
  4. Pin the add-on to the extension bar so that it is always easily accessible.
  5. Open a webpage and select a sentence or paragraph.
  6. Right-click and choose the “Copy link to selected text” option.

The selected text will turn yellow, indicating that you have successfully created and copied the link. The next time you or someone else uses the link, the web page will automatically scroll to the highlighted text.

The Link to Text Fragment feature also works with the Microsoft Edge browser. Here’s how to use it:

  1. Go to the Google Store and install the extension.
  2. Click the “Add to Chrome” button.
  3. The browser will ask you to confirm the installation of the add-on. Select “Add extension”.
  4. Pin the Link to Text icon for easy access if you use multiple extensions.
  5. Launch a website and select a portion of text.
  6. Right-click and press “Copy link to selected text”.

When the selected text turns yellow, the PC’ has copied the hyperlink. When someone taps on your link, the first thing they’ll see will be a highlighted part of the webpage.

Link to specific text on a webpage on a Mac

Safari is the built-in Internet browsing option for Mac products and does not offer any extensions that allow users to create predefined text links. Other browsers like Mozilla Firefox and Opera do not provide any link building solution. Fortunately, Mac devices work well with Microsoft programs, so you can highlight text and create hyperlinks on Google Chrome or Microsoft Edge.

The Link to Text Fragment extension will allow you to create a scrolling link to text on your Mac. To do this in Google Chrome:

  1. Go to the Chrome Web Store and install the Link to Text Fragment extension.
  2. Tap “Add to Chrome”.
  3. Open a webpage with the text you want to link.
  4. Select the text by dragging your cursor.
  5. Right-click on the selected text and press “Copy link to selected text” from the context menu.
  6. Once you have copied the link, the text will be marked in yellow. This indicates that the copied link is saved to the clipboard.

Anyone who clicks on your link will first see the highlighted snippet.

Since the Link to Text add-on works on Microsoft Edge, you can use this browser on your Mac to create specific text links. Do this:

  1. Install the extension from the Chrome Store.
  2. Press the “Add to Chrome” button.
  3. Select “Add Extension” when prompted to confirm action.
  4. Open a webpage with a piece of text you want to link.
  5. Use your cursor to select the text.
  6. Right-click on the text you selected and click “Copy link to selected text”.
  7. The text will turn yellow, indicating that the scroll link to the text has been stored in the clipboard.

Each time someone uses the link you created, the web page will scroll to the highlighted text.

Only Chrome or Edge users can access the web page through your link and see the marked text. If you sent the link to someone using another browser, they will see the page as it usually appears without the highlighted text box.

Share information more effectively with direct links

In an age of increasing access to information online, it is essential to have a way to access important texts more efficiently. To create links that will redirect users to the texts you have selected, use the Chrome or Edge browser on your PC or Mac. You can create scrolling links to text with bookmarklets or the Link to Text extension if you have a PC. Apple still hasn’t developed a similar add-on, but the extension also works with Mac devices.

How often do you highlight texts to share with others? Which of the above methods do you prefer for building links? Let us know in the comment section below.

Share.

About Author

Comments are closed.