Search code examples
htmlfaviconw3c-validation

Getting "there is no attribute 'REL'" on favicon tag when trying to validate page


When I try to validate my page using the W3C validation service, I'm getting this error:

Error  Line 13, Column 11: there is no attribute "REL"

<LINK REL="SHORTCUT ICON" HREF="favicon.ico" />

Why does this happen?


Solution

  • This is the code I'm using on my site:

    <link href="http://www.mysite.com/favicon.ico" rel="shortcut icon" />
    

    It works and is valid according to http://validator.w3.org/.

    I think the main problem with your code is that you're using uppercase letters. Use lowercase letters instead.

    Since your favicon probably is used on many pages, I also suggest you use the full adress, like in the code above, so that all files on your site can find the favicon no matter what folder they are in.