我想显示一个带有计数的点赞框,以便它显示为我的文字在这里 [点赞] <[2000]
默认情况下,点赞框在新行上,因此显示为
My text here
[Like] <[2000]
目前,我正在使用 CSS 通过以下代码相对定位 div:
<p><strong>My text here</strong></p>
<div class="fb-like" data-href="https://www.facebook.com/FacebookDevelopers" data-send="false" data-layout="button_count" data-width="450" data-show-faces="true" data-font="arial"
style="position:relative; top:-36px; left:230px;"></div>
有更好的方法吗?
最佳答案
嘿,现在已经习惯了这段代码并根据您的布局定义父 div 的宽度或高度
<p><strong>My text here</strong></p>
<div style="display:inline-block;
vertical-align:top;
position:relative;
width:200px;
height:100px;
">
<div class="fb-like" data-href="https://www.facebook.com/FacebookDevelopers" data-send="false" data-layout="button_count" data-width="450" data-show-faces="true" data-font="arial"
style="position:absolute;
top:0;
left:0;">
</div>
</div>
关于css - 显示与段落文本内联的 Facebook 之类的框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11751882/