I have seen everywhere <link rel="prev" href="example.com" being used but I came across a site which is using <rel link="prev" href="example.com"> and I wanted to know the difference between them , will this <rel link="prev" be creating any issues for the site.
7:19 pm on Jan 25, 2014 (gmt 0)
<rel link="..."> is not valid, and should not work. The site you came across has an error.
"link" is a tag. "rel" is an attribute. Some attributes (id, title) are universal or nearly so. Others can only be used with particular tags, like link + rel here. Some attributes are mandatory (an "img" has to give a "src" or you won't get anywhere). Others are optional.
9:51 pm on Jan 25, 2014 (gmt 0)
Fotiman thanks for your help.
Lucy24 thanks for helping as well but honestly it went over my head , do you agree with Fotiman that
<rel link="prev" href="example.com"> is not valid ?
Many Thanks both of you.
11:57 pm on Jan 25, 2014 (gmt 0)
Completely invalid. You can try the HTML validator [validator.w3.org] in Direct Input > HTML Fragment mode. Those few words
<rel link="prev" href="example.com">
net you three separate errors :)
there is no attribute "LINK" there is no attribute "HREF" element "REL" undefined
Yes, in that order. "These attributes don't exist, and by the way they're attached to an element we've never heard of." (The attribute "href" of course does exist-- but only if it's attached to an element that the validator is familar with.)
If you turn it around to
<link rel="prev" href="example.com">
the validator is happy. Well, not completely happy, because the <link> element is only allowed in a <head> section ... and then if you wrap the line in <head> </head> the validator throws even more errors. But at that point it's just funning with you ;)
Unlike some validator errors, here I don't see how the browser would even know what to do with "rel link..."
1:48 pm on Jan 26, 2014 (gmt 0)
Lucy Million Thanksssss for explaining it to a dumb ass person like me in such a simple way. You are genius......