Skip to content Skip to sidebar Skip to footer

In HTML, How Do I Link To Another 'instance' Of 'this' Document?

I want to do this for metadata purposes, rather than something that would explicitly displayed . So, for example, say my current document, Page A, is linked to from Page B e.g. a '

Solution 1:

Take a look at rel attribute.

I would suggest you in order to accomplish what you wrote, use , respectively inside an anchor tag


Solution 2:

The rel attribute (which can be used on link, a and area elements) specifies the link relationship type.

In HTML5, you may only use the following rel values:

If there is an appropriate link type depends on the specific relationship between your Page A and Page B. You only wrote "related article", but I don’t think that there would be a corresponding link type for such a general relation. I’d guess that all links on a page without a specific link type can be understood as "related".

You shouldn’t use next/prev unless your pages A and B are "part of a sequence".

If you don’t find appropriate link types, you may use RDFa Lite and/or Microdata and look for a suitable vocabulary. For example schema.org’s http://schema.org/WebPage specifies the relatedLink property:

A link related to this web page, for example to other related web pages.

It could look like (using RDFa Lite here):

<!-- on page B -->
<div vocab="http://schema.org/" typeof="WebPage">
  <a href="/article-a" property="relatedLink">Article A</a>
</div>

Post a Comment for "In HTML, How Do I Link To Another 'instance' Of 'this' Document?"