Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 valid Google+ Button - Bad value publisher for attribute rel

I recently migrated my website from xhtml transitional to html5. Specifically so that I could make use of valid block level anchor tags. <a><div /></a>.

When running validation I encountered the following error:

Bad value publisher for attribute rel on element link: Keyword publisher is not registered.

But according to this page, that is exactly what I am supposed to do.

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

My code:

<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>

I can't figure out how to implement this in an html5 compliant way. Can anyone help?

like image 232
mrtsherman Avatar asked Apr 13 '12 17:04

mrtsherman


1 Answers

1st) Within <head>:

<!DOCTYPE html>
<head>
    <!--head code-->
    <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
</head>

2nd) Anywhere within <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>



This code is valid AND "FRIEND'S" with http://validator.w3.org/

You can change https://plus.google.com/u/1/+StackExchange/ for any google+ url you desire (https://plus.google.com/xxxxxxxxxxxxxxxx/)

Documentation

like image 140
Omar Avatar answered Oct 14 '22 00:10

Omar