1

I'd like to provide a link to an external page (not under my control) that has a specific part where I want it to point to (it's a license page with an appendix, and I want the link to go directly to the appendix).

I would normally do this with a # in the URL, like this: https://en.wikipedia.org/wiki/Fragment_identifier#Examples

This makes the page scroll to already start on the HTML element with id="Examples".
The problem is when the HTML page doesn't put an id on the elements.

Is there any other way to make the URL point to the relevant section? Do URL fragments accept only ids or can I use other CSS selectors somehow?

geekley
  • 1,231
  • 10
  • 27
  • Can you give me the html of your section ? – saifur May 29 '19 at 18:21
  • Oh, I looked on the page today, and found an id now (I think it wasn't there before when I looked months ago). So my problem is solved, but the question remains: is it possible to reference an HTML element in the URL without being by id? – geekley May 29 '19 at 19:16
  • [How to create permalinks on particular position for web pages?](https://stackoverflow.com/q/29409402/1591669) – unor Jun 01 '19 at 16:06
  • So I assume that without an id it's not possible then. I wonder if the behavior of "browsers scrolling to show the element identified in a URL fragment" is just a convention that browsers happen to follow or if it's expected behavior (defined in a spec or something). – geekley Jun 01 '19 at 20:21

0 Answers0