问题
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
Change to using this style markup
<div class="g-plusone" data-size="tall" ... ></div>
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