开发者

Validation errors make no sense

Can someone explain to me the errors I am receiving while trying to validate my site, they are too long to mention here specifically but most are in reference to meta tags, if you go to w3c validation and validate, http://sunnahspace.com you will see the errors. I have a lot of difficulty understanding these errors when validating, a fix for these would be good but what I am looking for is someone who can explain WHY these errors are occurring so I don't have to ask for help every time I validate. Thanks i开发者_运维知识库n advance.


the SRC and META tag erros are probably because you are using XHTML and tags and attributes should be lowercase characters. The errors in the url (bid) are because you have to use a & character instead of &.


Error Line 5, Column 12: there is no attribute "name" Line 5, Column 28: there is no attribute "content" Line 5, Column 46: element "META" undefined

  • You used capital letters for META. This isn't valid code when using an XHTML doctype. You must use lowercase letters.

Error Line 21, Column 7: end tag for "META" omitted, but OMITTAG NO was specified Line 5, Column 1: start tag was here Line 21, Column 7: end tag for "head" which is not finished

  • You have to close each tag in XHTML with "/>" instead of ">" otherwise you will have invalid xhtml code.

Line 75, Column 18: there is no attribute "LANGUAGE" Line 75, Column 38: there is no attribute "SRC" Line 75, Column 128: element "SCRIPT" undefined

  • This is not valid xhtml code. It should be <script type="text/javascript" src="…"></script>

Line 75, Column 93: cannot generate system identifier for general entity "bid"

  • The & needs to be coded as &amp; so the browser can read the url correctly


I think it is because you are using an XHTML DocType but have uppercase tag names and attribute keys. All tag names and attribute keys should be lowercase. All attribute values should be enclosed in quotation marks.

<META name="y_key" content="dcd27d28fcb65dc2" />

should be

<meta name="y_key" content="dcd27d28fcb65dc2" />


Majority of your problems seem to be:

  • make tag names (script, meta) and attributes (src,language, content etc) lowercase.
  • The META tag is not closed.... I know... it's odd. remove / before it's close.
  • Javascript remove language or make it language="javascript" and close it with </script> instead of with a /> though I think it shouldn't matter for javascript tags.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜