Foolish Coder
Foolish Coder

Reputation: 405

How to fix this validation error?

I have following line in my page:

<a href="#" rel="toggle[home_right_animate_div1]" 
   data-openimage="/images/right_btn1_hover.png" 
   data-closedimage="/images/right_btn1.png">
  <img src="/images/right_btn1_hover.png" border="0" alt="" />
</a>

When I check this for HTML5 validation I'm getting following errors:

Error: Bad value toggle[home_right_animate_div3] for attribute rel on element a: The string toggle[home_right_animate_div3] is not a registered keyword.

validation

Upvotes: 1

Views: 103

Answers (1)

Mark
Mark

Reputation: 6855

For link elements with an href attribute and a rel attribute, links must be created for the keywords of the rel attribute:

those keywords over here @ W3

enter image description here

In plain english, you need to use one of those keywords, no custom naming convention allowed.

So that gives you 2 options:

  • leave it as it is (you probably need it for some scripting), not everybody has the browser inspector open to see the error.
  • or fix it by adding a custom data-rel attribute maybe, if scripting is envolved, you need the re-write that part of the script

Upvotes: 1

Related Questions