Reputation: 49
I have been banging my head for last many hour to get this solved but it is not working.
I want to display Facebook Like box, Twitter and Google + on one line but it displays them on different lines and just shows Facebook Like box correctly.
Here is the code I am using:
<div class="likefooter">
<iframe src="http://www.facebook.com/plugins/like.php?href={$my_base_url}{$story_url}& amp;layout=standard;&show_faces=false&width=450&action=like&font=arial&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px;"></iframe>
<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
<g:plusone size="medium" annotation="inline"></g:plusone>
</div>
CSS file is here: http://www.box.net/shared/2agu4dy10mb4y3pj7e1m
Upvotes: 0
Views: 7415
Reputation: 30256
<li>
display:inline
data-width
attribute from the <div class="fb-like">
tag.css:
ul.social { list-style: none outside none; }
ul.social > li { display:inline; }
html:
<ul class="social">
<li>
<div id="fb-root"></div>
<script>{{ facebook SDK script }}</script>
<div class="fb-like" data-href="{{ your URL }}" data-send="false" data-layout="button_count" data-show-faces="false"></div>
</li>
<li>
<{{ twitter button }}>
<script>{{ twitter javascript }}</script>
</li>
</ul>
Upvotes: 1
Reputation: 1
This code works:
<table cellpadding="4" style="width: auto !important; float: none !important; margin: 8px 0;">
<tr>
<td><img src="http://gnosisarts.com/home/images/fancy_g2.jpg" width="75" border="0" alt="Gnosis Media Group Internet PR Firm" /></td>
<!-- Google +1 Section Starts -->
<td>
<g:plusone size="tall" href="http://gnosisarts.com/home/Internet_PR"></g:plusone>
<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>
</td>
<!-- Google +1 Section Ends -->
<!-- Twitter Button Section Starts -->
<td>
<!-- async trick from http://techoctave.com/c7/posts/40-xhtml-strict-tweet-button-and-facebook-like-button -->
<script type="text/javascript">
//<![CDATA[
(function() {
document.write('<a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="gnosisarts" data-url="http://gnosisarts.com/home/Internet_PR">Tweet</a>');
var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0];
s.type = 'text/javascript';
s.async = true;
s.src = 'http://platform.twitter.com/widgets.js';
s1.parentNode.insertBefore(s, s1);
})();
//]]>
</script>
</td>
<!-- Twitter Button Section Ends -->
<!-- LinkedIn Button Section Starts -->
<td>
<script type="text/javascript">
//<![CDATA[
(function() {
var e = document.createElement('script');
e.type="text/javascript"; e.async = true;
e.src = 'http://platform.linkedin.com/in.js';
document.getElementsByTagName('head')[0].appendChild(e);
})();
//]]>
</script>
<script type="IN/Share" data-url="http://gnosisarts.com/home/Internet_PR" data-counter="top"></script>
</td>
<!-- LinkedIn Button Section Ends -->
<!-- Like Button Section Starts -->
<td>
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Ffacebook.com%2Fgnosisartsmediagroup&send=false&layout=box_count&width=65&show_faces=false&action=like&colorscheme=light&font=arial&height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:65px; height:65px;" allowTransparency="true"></iframe>
</td>
<!-- Like Button Section Ends -->
</tr>
</table>
Just change the social share URLs and other params to your own sites accordingly.
Eric
Upvotes: 0
Reputation: 11
The solution may be far easier -- the default width of the Facebook button is 250, open up the html and reduce it to 75 or so.
Upvotes: 1
Reputation: 13954
If CSS tweaks do not help make sure that your document is not rendering in quirks mode. Sometimes quirks rendering mode causes the +1 button to display on the next line.
You can check for this using Firefox webmaster tools or try tossing your page into a validator (http://validator.w3.org/) to make sure there aren't too many errors.
Upvotes: 0
Reputation: 61
please try
<div class="likefooter">
<div style="float:left;"><iframe src="http://www.facebook.com/plugins/like.php?href={$my_base_url}{$story_url}& amp;layout=standard;&show_faces=false&width=450&action=like&font=arial&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px;"></iframe></div>
<div style"float:left;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>
<div style="float:left;"><g:plusone size="medium" annotation="inline"></g:plusone></div>
</div>
Upvotes: 4
Reputation: 43
iFrame is a block-level element by default. You'll have to make the display:inline in the CSS. g:plusone might be one too, but I've never heard of that tag.
Upvotes: 0