Solved

Aligning Google plus one and Facebook networking buttons

Posted on 2011-09-24
3
1,061 Views
Last Modified: 2012-05-12
I want to align Facebook and Google plus one buttons horizontally.

The code I've written is as below. The buttons align in Chrome and Firebox but in IE they are split into two lines.

How do I align them using CSS and without using tables so that the code works in IE as well?

<div id="shares">
<span><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http://www.example.com" show_faces="false" width="300" font="lucida grande"></fb:like></span>
<span><g:plusone size="medium" annotation="inline" width="300" href="http://www.example.com"></g:plusone></span>
<script type="text/javascript">
  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>
</div>

Open in new window

0
Comment
Question by:noobie210
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
Dean OBrien earned 500 total points
ID: 36593194
try:

<style>
span {height:30px;vertical-align:middle}
</style>
0
 

Author Comment

by:noobie210
ID: 36595015
It works. For anyone else who is interested the new code is as below: Hope this is right, easynow111?
<div id="shares">
<span class="facebook" style="height:30px;vertical-align:middle;"><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http://www.example.com" show_faces="false" width="400" font="lucida grande"></fb:like></span>
<span class="google" style="height:30px;vertical-align:middle;"><g:plusone size="medium" annotation="inline" width="300" href="http://www.example.com"></g:plusone></span>
<script type="text/javascript">
  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>

Open in new window

0
 
LVL 12

Expert Comment

by:Dean OBrien
ID: 36595044
Glad it works, it was a stab in the dark really, wasnt sure how google/fb would output.

Cheers for points.

Easynow
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Technology Resume 7 88
Change color in a check box 8 35
problems with widget background image 9 34
Editing .asp website 5 30
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question