2012-08-01 38 views
0

我想與計數顯示樣箱,使其顯示爲我的文字在這裏 [贊] < [2000]顯示Facebook的樣箱內嵌段落文本

默認情況下,像盒子上新行,以便它顯示爲

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> 

有沒有更好的方法來做到這一點?

回答

0

嘿,現在使用此代碼,定義根據您的佈局父格的寬度或高度

<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> 
+0

這仍然出現在兩行 - 我試圖讓它出現在一行上。 – sinisterfrog 2012-08-01 04:31:07

+0

u能告訴我住在你網站的鏈接 – 2012-08-01 04:37:58

+0

你可以看到你的結果的定位和我在http://jsfiddle.net/ktzxN/ – sinisterfrog 2012-08-01 04:47:47

0

你給出的鏈接工作正常,你只需要添加以下你的CSS屬性<P>標籤,你需要添加CSS clear屬性還喜歡:

<p style="float: left;margin-right: 10px;"><strong>My text here</strong></p> 

請參考

http://jsfiddle.net/ktzxN/3/

希望它的作品!!!!!

0

請在以下鏈接中找到適用於多行文本的解決方案!

http://jsfiddle.net/ktzxN/4/

現在這個佈局變成液體,你在任何的分辨率,使用此佈局。!!!!!!

Hv Fun :-)

+0

與該段落一起浮動。我希望能夠將它與段落中的最後一個詞一起顯示,但是在其上方的任何行中。像這個評論之後我的用戶名/日期。 – sinisterfrog 2012-08-08 22:29:14