嘿,我想在标题标签(h2)旁边添加一个likebox,并将它保持在同一行。所以看起来像是:This is the Title LikeBox
然而,正在发生的事情是,Likebox正在开始这样的新行:
This is the Title
LikeBox
有没有人愿意帮我这个?如果有可能吗?
我的css是:
.post-details h2 {
border-bottom: 1px solid #E1E1E1;
font-size: 16px;
margin: 0 0 0 0;
padding: 0 0 5px 0;
font-weight: bold;
}
和html代码是:
<h2><?php the_title(); ?><h2>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="<?php echo get_permalink(); ?>" layout="button_count" show_faces="true" width="50" rel="nofollow"></fb:like>
感谢您的时间。
答案 0 :(得分:0)
请改用:
<div id="fb-root">
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="<?php echo get_permalink(); ?>" layout="button_count" show_faces="true" width="50" rel="nofollow"></fb:like>
</div>
<h2><?php the_title(); ?></h2>
然后在CSS中添加:
#fb-root {
float: right;
}
答案 1 :(得分:0)
@jonny h1,h2,h3,<p>
他们都自动获得100%的宽度。所以,你必须给你的h2
标签
.post-details h2 {
float:left;
border-bottom: 1px solid #E1E1E1;
font-size: 16px;
margin: 0 0 0 0;
padding: 0 0 5px 0;
font-weight: bold;
}
#fb-root {
float:right;
}