Validation error on rel value - html

Any ideas how I can fix this?
Line 58, Column 72: Bad value fancybox2 for attribute rel on
element a: Keyword fancybox2 is not registered.
…er.jpg" class="grid_1" rel="fancybox2"><img src="images/werk/klein/tubeplayer.…
Syntax of link type valid for <a> and <area>:
A whitespace-separated list of link types listed as allowed
on <a> and <area> in the HTML specification or listed as an
allowed on <a> and <area> on the Microformats wiki without duplicate
keywords in the list. You can register link types on the Microformats
wiki yourself.
<a href="images/werk/clipta.jpg" class="grid_1" rel="fancybox2">
<img src="images/werk/klein/clipta.jpg" alt="clipta"/></a>

The error message explains it rather well. You are using an HTML5 doctype, which means that HTML5 rules are applied, and they allow a specific list of rel values but with a wiki-based extension mechanism. This means that the rules for rel values may change at any moment without prior or posterior notice.
What should you do? First, consider why you are using rel="fancybox2". If you have sound reasons to think that some software makes some use of it, in a useful way, keep using it and ignore the error message. If not, remove the attribute.
Theoretically, you could and should register the attribute value if you think it is useful and well-documented. But this is something that should primarily be done by people who have invented the value and defined it and promote it and have some idea of how it supposed to work.

rel can only have one of the values specified in the list you see when you click on this link: w3schools/tags/att_a_rel
What dou you want to do in the first place?

The code you are using appears to abuse the rel attribute to describe something that isn't a relationship between the page and the content at the other end of the link. Change it to use a more appropriate means of storing the information, perhaps a class or a data-... attribute.

Related

Relative Anchor Tags from the same page

I have a page at http://mydomain/articles/20131114 I'd like to add an anchor to a comments section. Obviously I could add the full tag URL http://mydomain/articles/20131114#Comments but I'd also find it really useful at be able to add a relative anchor from inside the document (e.g. something like #Comments). I can't find much documentation on this question so I'm not sure if this is possible or not.
can you help
Thanks
You are looking for a "named anchor"
From
Go to Comments
Target:
<a name="comments">Here is the comments section</a>
Please note that newer browsers prefer an ID instead of name
HTML Anchors with 'name' or 'id'?
That means you can keep the link but access any object with an id, which has to be unique
<h1 id="comments">Comments section</h1>
Yes, this is possible and always has been possible. This will do what you want:
Go to comments
This will take you:
either to an a element with the name Comments
or to any element with the id Comments
I agree that it's a little hard to find a specification for this. The best one is probably the specification for URIs, page 27:
When a URI reference refers to a URI that is, aside from its fragment component (if any), identical to the base URI (Section 5.1), that reference is called a "same-document" reference. The most frequent examples of same-document references are relative references that are empty or include only the number sign ("#") separator followed by a fragment identifier.

Meaning of Rel atttibute

I found a strange a href in a webpage. It looks like
<a href=... rel="servername.com|6d63402c" ...other properties... ></a>
What does cryptic |6d63402c mean ? Is it a bitwise OR operation or just a string?
The document contains different links with different rels in this style.
The rel attribute specifies the link relationship type.
In HTML5 you may only use rel values that
are defined in the HTML5 specification, or
are registered in the Microformats wiki page existing rel values: HTML5 link type extensions.
As the value servername.com|6d63402c is not defined/registered, the page uses invalid markup.
As to what this specific value does: we can’t know (well, because it is not defined/registered). It’s probably some internal or third-party script that makes use of it. They should better use the data-* attribute instead of misusing rel.
Per the tag wiki:
The rel attribute is used in HTML elements to specify the relationship and connection between the current document and the linked document.
Sources: W3C (link)
Source: W3Schools (link)

Is it possible to specify user agent with URL in HTML?

I'm working on a mail server that sends HTML emails down to a mail client. Can the HTML DOM be modified to indicate that either a single or all URLs (<a href=""> elements) use a specific user agent? The integrated browser in our custom client could inspect the HTML to determine what user agent to use and then take that into account when opening the URL.
If it's possible to add a custom (non-standard) attribute to the <a> element or possibly a child element to it, that'd work too, if it's valid to do so. Thanks in advance.
Can the HTML DOM be modified to indicate that either a single or all URLs (<a href=""> elements) use a specific user agent?
Not in any standard way.
If it's possible to add a custom (non-standard) attribute to the element or possibly a child element to it, that'd work too, if it's valid to do so.
"non-standard" is practically invalid by definition.
There is a loophole in data- attributes (since they are defined by the specification as a way to add extensions) but:
"These attributes are not intended for use by software that is independent of the site that uses the attributes"
HTML 5 is a Candidate Recommendation, not a standard.

HTML rel="up" attribute?

I'm using mobile template HTML files on a PHPBB forum.
I tested the html for errors at http://validator.w3.org/
The test results showed the following error
Line 24, Column 66: {navlinks.FORUM_NAME}
Bad value up for attribute rel on element a: The string up is not a registered keyword or absolute URL.
Not having heard back from the author and not finding much on Google search, I'm trying to understrand what rel="up" does, if anything constructive.
Can't find any mention as an official HTML attribute
http://www.w3schools.com/tags/att_link_rel.asp
wondering if it's probably safe to just remove the phrase rel="up"
The Internet Assigned Numbers Authority (IANA) keeps a list of link relationships The latest version is from March 21 2013.
up: Refers to a parent document in a hierarchy of documents.
Unfortunately, despite the fact that this registry was long established, it was decided that HTML5 would not use this registry and would use a Wiki page to list the conforming link types instead.
Up, is listed in a rather insane section marked "dropped without prejudice", which nobody seems to know what to do with, or how to get those link types out of.
It's safe to drop it, but some browsers and browser plugins make use of it. For example, I use a Firefox plugin called "Link Widgets" like this to make use of the link type.
From: http://www.w3.org/MarkUp/html3/dochead.html
REL=Up
When the document forms part of a hierarchy, this link references the immediate parent of the current document.
If this is causing any specific problems or unexpected results, please post your code. Thanks.

Unregistered values of rel attribute in anchor tag

I used rel values in jQuery for the parametrized (#!hashbang) AJAX calls.
<a id='_qualifier' rel='telephony' href='contact.php'>contact</a>
and with jQuery:
var hashbang = "#!"+$("#_qualifier").attr('rel'); //gives desired result=>"#!telephony"
But, when I validated the page on validator.w3.org, it gave me error:
Bad value #telephony for attribute rel on element a: Keyword #telephony is not registered.
I searched around and according to the HTML5 specs here and here, the rel attribute should have the registered/pre-defined values.
Is there a work around to use custom values for rel in HTML5, without failing the validation?
Is it also invalid for HTML4 doctypes?
You can use custom attributes:
...
It is HTML5 compliant, but not HTML4 or xHTML.
You'll access the attribute just like you did with jQuery.
You can find more informations on the HTML5 reference.
Is there a work around to use custom values for rel in HTML5, without failing the validation?
The microformats page is a Wiki. If you are satisfied that you are using rel correctly and that there is no other appropriate rel value already registered, you can add you own value as a Proposed value. Instructions for doing so can be found here: http://dev.w3.org/html5/spec/links.html#other-link-types
According to the HTML5 spec, this will make your rel value valid. Of course, it may take some time before automated validators catch up with this, but that's just a technical matter.
Is it also invalid for HTML4 doctypes?
No, it isn't.
You can use any other attribute of 'a' tag for eg. 'title'