Skip to content

Instantly share code, notes, and snippets.

@jhammann
Created March 12, 2013 16:31
Show Gist options
  • Save jhammann/5144410 to your computer and use it in GitHub Desktop.
Save jhammann/5144410 to your computer and use it in GitHub Desktop.
When you put the 'like' and 'tweet' social plugins next to each other the 'tweet' button's position is always a few pixels lower than the 'like' button. This is a simple fix for that annoying occurrence using the iframe option for Facebook's social plugin.
.social_plugins iframe {vertical-align:top;}
<div class="social_plugins">
<a href="https://twitter.com/share" class="twitter-share-button" data-via="twitter" data-lang="en" data-count="none">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Furl.com&amp;send=false&amp;layout=button_count&amp;width=90&amp;show_faces=false&amp;font&amp;colorscheme=light&amp;action=like&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment