0

What is the HTML5 alternative for rel="" in the following code:

<span class="gte" rel="gte">

Without the rel="" attribute, the page is not functional, nor will it validate as HTML5 compliant.

Matt
  • 1,561
  • 5
  • 26
  • 61

1 Answers1

4

The rel attribute is perfectly valid in HTML5, so it doesn't need an alternative, however it needs to be on a a, link or area element, because it defines the *rel*ationship between the current document and the linked document. Having it on an element which is not a type of link doesn't make any sense.

In order for your markup to validate you need to change the span to a or link and the value you use with the rel attribute needs to be allowed by the link types listed in the spec or have been approved by the microformats development process. I don't see gte listed in either place, maybe you could explain what you expect it to mean?

You say 'the page is not functional' but do not describe what functionality you're expecting? Normally a rel attribute does nothing, it's just semantic information. If you're just trying to add additional information to this element for use in by a script or other tool related to your own site then you should instead use data-* attributes.

If this information isn't helpful to you, perhaps you can explain more clearly what your problem is?

robertc
  • 74,533
  • 18
  • 193
  • 177