Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use custom image for Google+1 button?

I want to include a "google+1" button on a page, yet I want to use a custom image with a custom size for it and preferably without javascript, much like is possible to do with Facebook and Twitter. I don't care if it don't show the count number for now.

like image 634
peroyomas Avatar asked Jul 05 '11 16:07

peroyomas


People also ask

Can I use image as button?

The image buttons in the HTML document can be created by using the type attribute of an <input> element. Image buttons also perform the same function as submit buttons, but the only difference between them is that you can keep the image of your choice as a button.

How do I change the image on a button?

The default button in HTML can be changed to an image using CSS. The required button is selected using the respective CSS selector. The background property can then be set to include a background image and change the image type as required. The border of the button can also be removed to show only the image itself.


2 Answers

Finally! Found a nice solution to this problem. So simple and working :) Hope it helps you!

<a href="https://plus.google.com/share?url=ADD_YOUR_URL" >     <img src="path_to_your_image" alt="Google+" title="Google+"/> </a> 

Source: http://notesofgenius.com/how-develop-custom-google-plus-button/

like image 171
Aaviya Avatar answered Dec 10 '22 11:12

Aaviya


This is the official example from the google developers page:

Also consider that the URL was updated.

<a href="https://plus.google.com/share?url={URL}" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">   <img src="https://www.gstatic.com/images/icons/gplus-64.png" alt="Share on Google+"/> </a> 
like image 35
Ghigo Avatar answered Dec 10 '22 11:12

Ghigo