Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Responsive facebook comment box

I've been researching several different ways to force a facebook comment box plug-in to be fluid/responsive/liquid/whatever-we-call-it (just showing the stupidity of names), and all of them work fine. But also, all of them make the plug-in disappear when accessing from Google Chrome.

I'm using this:

.fb-comments, .fb-comments span, .fb-comments.fb_iframe_widget span iframe {
width: 100% !important;
}

Which has the same results (apparently) as:

#fbcomments, .fb-comments, .fb-comments iframe[style], .fb-comments span{
width: 100% !important;
 }

Question: How can I fix this strange behavior? (Why does it happen?)

Thanks for your time. Wether you do help me or not, have a nice to-day! :)

like image 330
Álvaro N. Franz Avatar asked Nov 22 '13 11:11

Álvaro N. Franz


2 Answers

this worked for me: Add to the fb-comments div data-width="100%"

<div class="fb-comments" data-href="http://example.com/comments" data-width="100%" data-numposts="5" data-colorscheme="light"></div>

and it will be responsive when you resize the browser.

you can put the fb-comments div inside another div and give that div the width you want.

like image 120
gegham Avatar answered Oct 22 '22 02:10

gegham


This is facebook comment part-

<div class="fb-comments" data-href="http://example.com/comments" data-numposts="5" data-colorscheme="light"></div>

Just add this CSS bellow the div-

<style>.fb_iframe_widget span[style]{width:100% !important;}</style>
like image 21
M B Parvez Rony Avatar answered Oct 22 '22 03:10

M B Parvez Rony