Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to bookmark or link to a section of a page without an anchor?

Is there a way to bookmark or link to an HTML page (which I am not author of) without having an anchor in the HTML code?

I want the page to get scrolled down to a particular section when accessed from a bookmark or hyperlink even if there is no anchor tag in the destination page.

Note: the destination page has an anchor tag as "foo" then bookmarking like http:/...hello.html#foo will not only take the user to hello.html, but also automatically scroll down to the section of the page so that the anchor tag "foo" is at the top of the screen.

like image 409
Neil Avatar asked Nov 02 '11 15:11

Neil


People also ask

Can I link to a specific part of a page?

Typically, when you create an external hyperlink, you can simply use the URL. Since you're linking to a certain part of your page, it's important to have a title for where the link is going. It may be beneficial to name it something that is related to the link's destination.

How do you link to a section of an article?

Steps to add an anchor tag:Open any article from your Knowledge Base. Click on 'Edit' and then click on the 'Code view' option of the article. Navigate to the section your anchor should jump to, when clicked. Add an ID in the element for that section, as shown (example: id="anchor" )


1 Answers

It's the year 2020, there is a draft by WICG for Text Fragments, and now you can link to text on a page as if you were searching for it by adding the following to the hash

#:~:text=<Text To Link to>

Working example on Chrome Version 81.0.4044.138:

Click on this link Should reload the page and highlight the link's text

like image 91
Abderrahmane TAHRI JOUTI Avatar answered Sep 21 '22 20:09

Abderrahmane TAHRI JOUTI