Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What I've done was putting behind the Facebook like button a zero-count balloon which looks just like Facebook's. The tricky part was positioning it in the right place since apparently the width of the like button itself is different per browser and there's no way to depend on its flow since it's in a separate iframe.</p> <p>Here's how it looks:</p> <ul> <li><p>DOM (everything within fb_bg_count_balloon, is from facebook's iframe):</p> <pre><code>&lt;div class="fb_like_container"&gt; &lt;div class="fb_bg_count_balloon"&gt; &lt;table cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td&gt; &lt;div class="fb_count_nub"&gt; &lt;s&gt;&lt;/s&gt;&lt;i&gt;&lt;/i&gt; &lt;/div&gt; &lt;/td&gt; &lt;td&gt;&lt;div class="fb_count_count"&gt;0&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt; &lt;div class="fb_like_foreground"&gt; &lt;fb:like href="http://yoururl.com/path" send="false" layout="button_count" width="90"&gt;&lt;/fb:like&gt; &lt;/div&gt; &lt;/div&gt; </code></pre></li> <li><p>SCSS (I find it much more readable than plain CSS - it's what enables the nested selectors here - you can translate it to valid plain CSS quite easily by flattening the nesting):</p> <pre><code>.fb_like_container { width:90px; position:relative; .fb_bg_count_balloon { position:absolute; top: 1px; right: 13px; font-family: "lucida grande",tahoma,verdana,arial,sans-serif; font-size: 11px; color: #333; .fb_count_nub { display: block; position: relative; z-index: 2; height: 0; width: 5px; top: -5px; left: 2px; s, i { display: block; border-style: solid; border-color: transparent; border-right-color: #D7D7D7; border-width: 4px 5px 4px 0; position: relative; top: 1px; } i { left: 2px; top: -7px; border-right-color: white; } } .fb_count_count { background-color: white; border-style: solid; border-color: #D1D1D1; border-width: 1px; height: 14px; margin-left: 1px; min-width: 15px; padding: 1px 2px 1px 2px; text-align: center; line-height: 14px; white-space: nowrap; } } .fb_like_foreground { position:absolute; left: 0; top: 0; z-index:3; } } </code></pre></li> <li><p>And the happy tweaks for IE:</p> <pre><code>&lt;!--[if IE 9]&gt; &lt;style type="text/css"&gt; .fb_like_container .fb_bg_count_balloon { right: 16px; } &lt;/style&gt; &lt;![endif]--&gt; &lt;!--[if lte IE 8]&gt; &lt;style type="text/css"&gt; .fb_like_container .fb_bg_count_balloon { top: 2px; right: 17px; } &lt;/style&gt; &lt;![endif]--&gt; </code></pre></li> </ul> <p>The problems with this way are:</p> <ol> <li>If facebook changes anything, it'll probably break (at least visually)</li> <li>When loading, until facebook parses your fb:like, you'll have only the balloon.</li> <li>FB's "fb_count_nub" is disgusting, but I guess quite portable - You can just replace it all (fb_bg_count_balloon's content) with an image.</li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload