HTML5有效的Google+按钮 - 属性rel的错误值发布商

mrt*_*man 6 html5 google-plus-one

我最近将我的网站从xhtml过渡迁移到了html5.具体来说,我可以使用有效的块级锚标签.<a><div /></a>.

运行验证时遇到以下错误:

属性链接的元素链接的错误值发布者:未注册关键字发布者.

但根据这个页面,这正是我应该做的.

https://developers.google.com/+/plugins/badge/#connect

我的代码:

<link href="https://plus.google.com/xxxxxxxxxxxxxxxx" rel="publisher" />

<a href="https://plus.google.com/xxxxxxxxxxxxxxx?prsrc=3" style="text-decoration:none;">
  <img src="https://ssl.gstatic.com/images/icons/gplus-16.png" alt="" style="border:0;width:16px;height:16px;"/>
</a>
Run Code Online (Sandbox Code Playgroud)

我无法弄清楚如何以符合html5的方式实现它.有人可以帮忙吗?

Oma*_*mar 3

1st ) 以内<head>

<!DOCTYPE html>
<head>
    <!--head code-->
    <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
</head>
Run Code Online (Sandbox Code Playgroud)

2nd ) 任何地方<body>

<body>
    <!--body code-->
    <div class="g-plusone" data-size="small" data-annotation="none" data-href="https://plus.google.com/u/1/+StackExchange/"></div>
</body>
Run Code Online (Sandbox Code Playgroud)



此代码有效且为“朋友”,http://validator.w3.org/

您可以更改https://plus.google.com/u/1/+StackExchange/任何您想要的 google+ 网址 ( https://plus.google.com/xxxxxxxxxxxxxxxx/)

文档