Solved

Aligning Google plus one and Facebook networking buttons

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

896 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

16 Experts available now in Live!

Get 1:1 Help Now