Regarding <a> and rel attribute

when creating multiple internal links in the same page, do we need to specify ‘rel=internal’, like , or is it not important.

1 Like

I’ve never read anything about it being mandatory and I’ve never seen it specified in a course, but it could be helpful for anyone doing SEO.

Don’t think that’s even a thing, there is no such link type


https://www.w3.org/TR/html50/links.html#linkTypes

I found that attribute in the technical documentation example project on CodePen. It confused me too.

that is only used when you’re assigning a stylesheet to your html or other external file where you tell the browser what is the file’s relationship to html

The projects need to be updated, they have a bunch of invalid HTML. I have updated some of the projects in the repo but the Codepen’s are still not updated. Not sure when they will be.

Anyway, it is invalid HTML.

Error: Bad value internal for attribute rel on element a: The string internal is not a registered keyword.

1 Like

Hi, @lasjorg. I’m not so sure that rel=internal is considered invalid HTML. Can you link the HTML validator and Markup your using to produce said error?

To my understanding, the HTML spec states that the rel attribute: “Defines the relationship between the document containing the hyperlink and the destination resource”.

Many pages on MDN still use <a rel="internal" href="some link">Link text</a> and its valid HTML.

I ran this validation check on a page with many rel="internal" attributes used and the Nu HTML Checker didn’t throw any errors for a bad value unless the value was indeed not formatted correctly as an unordered set of unique space separated tokens for the rel attribute. Let me know your thoughts!

This was a long time ago so I can’t give you the code I checked, I have no idea what it was. All I know is, I can’t find the internal value in the specs anywhere.

https://www.w3.org/TR/html52/links.html#element-attrdef-a-rel
https://html.spec.whatwg.org/multipage/links.html#linkTypes
https://www.w3.org/TR/html52/links.html#allowed-keywords-and-their-meanings

So rel="internal" is either non-standardized (maybe use by some browser at some point) or it has vanished into thin air from the specs.

There is a external value so one might assume the opposite is implied if that value is not specified.

1 Like