Google +1 code validation error: missing attribute

我的未来我决定 提交于 2019-12-13 01:25:00

问题


My code: <g:plusone annotation="inline"></g:plusone>

I get this error:

there is no attribute "annotation"
element "g:plusone" undefined

Why?


回答1:


You have two choices

  1. Change to using this style markup <div class="g-plusone" data-size="tall" ... ></div>

  2. Add the XML NS for google's <g: syntax to the <html tag of the document. Now if only Google would share where that xml namespace is located... (So really, just try option 1)




回答2:


There is no attribute called "annotation" for any element recommended in the W3C standards. Google probably uses it to parse for some backend processing. If you want the +1 element, you cannot have a W3C standards code.

Check this thread. So what if custom HTML attributes aren't valid XHTML?



来源:https://stackoverflow.com/questions/9139019/google-1-code-validation-error-missing-attribute

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!