Aligning 3 buttons in div horizontally
How can I align this 3 buttons horizontally in xhtml? This is for blogger by the way.
Here's my xhtml for the buttons:
<div class='fb-like'>
<fb:like action='like' expr:href='data:post.url' font='arial' layout='button_count' send='true' show_faces='true' width='450'/>
</div>
<div><b:if cond='data:blog.pageType != "static_page"'>
<g:plusone annotation='inline' width='450' expr:href='data:post.url'></g:plusone>
</b:if></div>
<div><b:if cond='data:blog.pageType != "static_page"'>
<a class='twitter-share-button' data-count='none' data-via='MarvinVista' expr:data-text='"Currently reading: " + data:post.title' expr:data-url='data:post.url' href='http://twitter.com/share'>Tweet</a开发者_如何学JAVA>
</b:if></div>
You can place them in a containing div
, give each div
a set width and then float
them to the left.
HTML
<div class='fb-like share-button'>
<fb:like action='like' expr:href='data:post.url' font='arial' layout='button_count' send='true' show_faces='true' width='450'/>
</div>
<div class="share-button"><b:if cond='data:blog.pageType != "static_page"'>
<g:plusone annotation='inline' width='450' expr:href='data:post.url'></g:plusone>
</b:if></div>
<div class="share-button"><b:if cond='data:blog.pageType != "static_page"'>
<a class='twitter-share-button' data-count='none' data-via='MarvinVista' expr:data-text='"Currently reading: " + data:post.title' expr:data-url='data:post.url' href='http://twitter.com/share'>Tweet</a>
</b:if></div>
CSS
.share-button{display:inline-block;}
精彩评论