Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Responsive design 响应式facebook评论框_Responsive Design_Facebook Comments_Fluid Layout - Fatal编程技术网

Responsive design 响应式facebook评论框

Responsive design 响应式facebook评论框,responsive-design,facebook-comments,fluid-layout,Responsive Design,Facebook Comments,Fluid Layout,我一直在研究几种不同的方法,以迫使facebook评论框插件具有流畅性/响应性/流畅性/无论我们称之为什么(只是显示名称的愚蠢),所有这些方法都可以正常工作。而且,当从谷歌浏览器访问时,所有这些都会使插件消失 我用这个: .fb-comments, .fb-comments span, .fb-comments.fb_iframe_widget span iframe { width: 100% !important; } 其结果(显然)与: 问题:如何纠正这种奇怪的行为?(为什么会发生?)

我一直在研究几种不同的方法,以迫使facebook评论框插件具有流畅性/响应性/流畅性/无论我们称之为什么(只是显示名称的愚蠢),所有这些方法都可以正常工作。而且,当从谷歌浏览器访问时,所有这些都会使插件消失

我用这个:

.fb-comments, .fb-comments span, .fb-comments.fb_iframe_widget span iframe {
width: 100% !important;
}
其结果(显然)与:

问题:如何纠正这种奇怪的行为?(为什么会发生?)


谢谢你抽出时间。不管你帮不帮我,祝你今天过得愉快!:)

这是facebook的评论部分-

<div class="fb-comments" data-href="http://example.com/comments" data-numposts="5" data-colorscheme="light"></div>
<style>.fb_iframe_widget span[style]{width:100% !important;}</style>

只需将此CSS添加到div下面即可-

<div class="fb-comments" data-href="http://example.com/comments" data-numposts="5" data-colorscheme="light"></div>
<style>.fb_iframe_widget span[style]{width:100% !important;}</style>
.fb\u iframe\u小部件span[style]{宽度:100%!重要;}

这对我有效:添加到fb评论div data width=“100%”


当你调整浏览器的大小时,它会做出响应

您可以将fb comments div放入另一个div中,并为该div指定所需的宽度。

只需在div中插入data width=“100%”


您可以使用data mobile atribute

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

这肯定会像Facebook文档中所述那样起作用:
数据宽度
:插件的宽度。像素值或流体宽度的100%文字。移动版的Comments插件忽略了width参数,而是将流体宽度设置为100%@现在是Ja8zyjits;)-在询问时,数据宽度不可用。谢谢