Solved

Aligning Google plus one and Facebook networking buttons

Posted on 2011-09-24
3
1,052 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
  • 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now