I have a black web page at yourcashflowpros.com that integrates with fb comments. Fb comments looks like $&%! against a black bg, can someone tell me if i can change the css on the comments or should I just change the background to make it look right?
Thanks
Todd
Well, its in an iframe so your css wouldn't affect it. The easy approach would be to make the background container of your fb:comments block white (with a little padding on left and right), that would make the comments block look right.
change
<fb:comments width="900"></fb:comments>
to
<fb:comments width="900" style="background-color: white; padding 10px;"></fb:comments>
The fb:comments tag has a css attribute you can specify to pull in your external stylesheet.
<fb:comments numposts="4" title="My Blog Comments" css="http://www.yourwebsite.com/css/comments.css?1234" simple="1"></fb:comments>
http://developers.facebook.com/docs/reference/fbml/comments_(XFBML)/
Related
I am having a problem getting a div containing facebook like/send buttons to expand when the buttons are clicked. I have searched and tried and tried to fix this, but I'm hitting a wall. I believe it has something to do with how the buttons render an iframe, but I'm not sure.
Here's the code, plain and simple (with an example link for og data).
<div id="fb_btns">
<fb:like href="http://www.imdb.com/title/tt0117500/" data-send="true" layout="button_count" width="450" show_faces="false" ></fb:like>
</div>
and the non-expanding div can be seen here
http://spadeballink.com/GALLOWS/TheGoddamnGallows.html
Any help counts! Thanks in advance!
*Also there is no css declaring the height of this div, the only heights declared are for html and body to be 100% (needed for the background image).
Are you using XFBML or Iframe version of like button? For Iframe version you need to use layout=standard for people to be able to see fly-out comment box.
I created a fanpage and integrated a app with width 520px. Everything works fine but the context is 5px to 10px shifts to the right and so on there is a scrollbar shown at the end of page. How can I solve this.
I know scrollbars can be hidden with overflow:hidden and inside tag <body scroll=no> but this doesn´t solve the shift to the right.
You can try using the FB.Canvas.setAutoGrow method :
Please read the Facebook JS SDK Documentation of the FB.Canvas.setAutoGrow method. In that link is an explanation on how to use facebooks auto size functions to fix these sorts of problems.
The problem seems to be that facebook fanpages tabs have a html - padding with 8px!!!! to solve this I set in css: <body style="position:relative;left:-8px;">
is it possible to create simple Like button for fan page? When I create official Like button, insert my fan page URL in form, it always generate button with image and page title as it is Like box not Like button. I just want simple Like button only with "Like" label and users count.
Is this an issue or default behavior, or just my misunderstanding?
Thanks for advice
Tomas Teicher
Did you mean you want this button?
http://developers.facebook.com/docs/reference/plugins/like
Alternatively, you may use AddThis widget - They even provide analytics for you.
http://www.addthis.com/
I use the widget on this website: http://muamalat.com.my/consumer-banking/financing/mortgage/
I must have misread your question. In that case I've only come across this: http://developers.facebook.com/docs/reference/plugins/like-box/
Uncheck show faces, stream and header; that's the cleanest you could get. Is this what you're looking for?
I don't think AddThis has that feature you speak of. :)
One way to only show the like button by itself is to hide the top part of the button by setting the iframe dimensions to the size of the button: 60x20.
<iframe src="http://www.facebook.com/plugins/like.php?&href=&send=false&layout=button_count&width=60&height=20&show_faces=false&action=like&colosheme=light"
allowtransparency="true" frameborder="0" scrolling="no"
style="width: 60px; height: 20px;">
</iframe>
If you are using Iframe you need to place an http or https: because >iframe starts as
<iframe src="//www.facebook.com/plugins/likebox.php?href= ................></iframe>
and you need to place
<iframe src="**http:**//www.facebook.com/plugins/likebox.php?href= ................></iframe>
The above answer did help me in finding that out.
If i read this correct, then it is definitely possible:
https://developers.facebook.com/docs/reference/plugins/like/
Put in your Page URL, for example: https://www.facebook.com/bladauhu
(that is my own page)
Uncheck Send Button, use Layout Style "button_count", uncheck Show Faces. Leave the rest as it is and click on the "Get code" button. Use the HTML5 or XFBML Version.
For me, this works just like every other Website and it shows the correct number of likes from the Facebook Page. No additional Images, just the plain and simple Like button.
Adding data-layout='button_count' to the HTML5 version worked for me:
<div class="fb-like" data-href="http://facebook.com/wewantoo" data-send="false" data-width="90" data-show-faces="false" data-layout='button_count'></div>
I added face book like button on my site is there any way to disabled the count which is display next to the button.
http://www.knowledgenotebook.com/FB/notShow.png
You can but not directly.
You have to set data-layout="box_count", wrap button code with extra element, set overflow and move button up. It will be something like that:
<style>
.fb-wrap {height:20px; overflow:hidden;}
.fb-wrap div {position:relative; top:-41px;}
</style>
<div class="fb-wrap"><div class="fb-like" data-href="http://mysite.com/" data-send="false" data-layout="box_count" data-show-faces="false"></div></div>
This will work more bulletproof than crop by width because of internationalization
Yeah, honestly I'm very disappointed that Facebook still didn't do anything to make the button configuration easier (show/hide count, change size, etc.). All the other mayor social buttons - Twitter, G+, LinkedIn, Pinterest have this option available, and there's no need to make CSS workarounds which not always work (mentioned above case of different languages).
For simple sites, just add a fixed width to the iframe ( width:47px !important; )
For the multilingual sites where you have to display the Like/Recommend text in more than one language (EN: Recommend, DE: Empfehlen) the text length is different and you can't set a fixed width, but you can use layout=box_count and set a fixed height:
height: 70px; margin-top:-41px;
You can't.
http://developers.facebook.com/docs/reference/plugins/like
The count is not a configurable attribute
You can. All you need to do is set the width to 47 in facebook's iframe code.
There are a few answers for the different cases where you can hide the count in the answers here:
Facebook Like-Button - hide count?
The side effect is that you have to hide the comment flyout as well.
The default attributes you have available are here:
http://developers.facebook.com/docs/reference/plugins/like/
The code loads an iFrame on your site and you maybe able to adjust the size of the iFrame to hide certain components based on the design "Layout Style" you choose.
You can hide it using css styles, adjusting the width and hiding overflow, but be aware it's forbidden.
Facebook Policy
IV. Application Integration Points
4 d. You must not obscure or cover elements of our social plugins, such as the Like button or Like box plugin
If you want to include a share and like button (and don't need internationalization) this works:
<style>
.fb-wrap {height:20px; overflow:hidden;}
.fb-wrap div {position:relative; left: 27px; margin-left: -27px;}
</style>
<div class="fb-wrap">
<div class="fb-like"
data-width="160"
data-layout="button_count"
data-show-faces="false"
data-send="true">
</div>
</div>
All I had to do was change data-layout attribute from "box-count" to "button". Worked fine.
<div class="fb-share-button" data-href=#longURL data-layout="button">
How to control the facebook like box stream part height alone. Its normal to reduce height of whole box but if tries to control it fans images are not shown.
The css .fan_box .page_stream{ ...,width:300px} to .fan_box .page_stream{...,width:150px}
i'm asking because the stream box inside iframe
There isn't a way to change the height. Facebook doesn't provide a way to change the height and there isn't a way to change the height using JavaScript and CSS.
Why can't I do it with JavaScript and CSS?
CSS just doesn't apply through an iFrame because thats how an iFrame works -- its basically a window to another page with its own CSS.
Javascript won't allow you to access the content of an iFrame if the URL of the iFrame is different than the page that contains the iFrame. Doing:
document.getElementById('iframeID').contentWindow.document
Will give you the following warning in Chrome.
Unsafe JavaScript attempt to access frame with URL... Domains, protocols and ports must match.
The reason for this is to prevent XSS. Here's more on the Same Origin Policy.
I saw this on the Like Box page and figured I'd respond that you can use the 'data-height' attribute:
data-height="250"
Worked for me. Here's my example:
http://www.skonet.com/Resources/Articles/Index.aspx
you can reduce the height of the encasing div, hide its overflow and if you want push the top of it underneath an absolutely positioned element with a higher z-index like so:
<div style="position:absolute;z-index:2;top:0;left:0;width:300px;height:130px;background-color:#c0c;opacity:0.5;filter:alpha(opacity=50);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";"></div>
<div style="height:140px;width:140px;overflow:hidden;background-color:#0c0; margin-top: 60px;color: #fff;padding: 30px;font-family:arial;">
facebook like box goes here - only the green part will be visible if you make the pink box white and take out the 0.5 opacity and the bottom will get cut off so you can just display whatever part you want
</div>
I suppose you guys still need it and this is the most acurate trick I can provide and its also promising to work with the every day changing of the facebook like box by facebook.
Its a bit tricky but will work for you guys..
create two seprate like box of the same page, and close them in seprate div right in my case
<div class="up1">
facbook like box 1 code
<div class="up2">
facbook like box 2 code
Now in the css
use position absolute to class up1
.up1 {
position:absolute;
z-index:99999;
background-color:white;
}
and in up2
.up2 {
padding-top:87px;
}
What it does it will put the box 1 over the box 2 hiding its facebook like and bla bla making it feel like you have one box that contain picture and streaming of your desired lenght
I was looking around cos I had a problem like this one. Facebook has no standard way of customizing the stream if the faces and header are checked.
The solution is to take them differently. If you need the stream as long as 1000px, just uncheck everything except the stream. This will change its height from the default 300px to whatever value you type in the height field.
See an example below:
<div class="fb-like-box" data-href="https://www.facebook.com/MadeinHeavenEvents" data-width="800" data-height="2000" data-colorscheme="light" data-show-faces="false" data-header="false" data-stream="true" data-show-border="true"></div>
Then if you still need the one with faces, get a new code and set the height differently, then uncheck the others. Below is an example:
<div class="fb-like-box" data-href="https://www.facebook.com/MadeinHeavenEvents" data-width="800" data-height="500" data-colorscheme="light" data-show-faces="true" data-header="true" data-stream="false" data-show-border="true"></div>
Don't forget to add the SDK before these codes.
I know it's a long time since this was posted, but here is the solution that helped me today
Yes the data-height to 250 will work as it reduce the outside iframe
Now try to set data-height to 1000 - it is still 300px height,
because the inner div inside the iframe hard coded to 300px and
you can not control that as it is in a cross domain iframe...
<div class="fb-like-box" data-href="http://www.facebook.com/example" data-width="292" data-height="250" data-show-faces="true" data-stream="false" data-header="false"></div>
Adjust the height in this code to what works best for you.