一直在努力解决完全相同的问题。一个快速简单的解决方案是使用基于 iframe 的 Facebook Like 框。
<iframe class="fb-like-box" src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fplatform&width=292&height=500&colorscheme=light&show_faces=true&border_color&stream=true&header=true" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
请注意分配的“fb-like-box”类和所有已删除的内联样式。iframe 的类可能如下所示:
.fb-like-box {
width: 100% !important;
height:500px;
border:none;
overflow:hidden;
}
看起来 iframe 的 src 标签中定义的高度和宽度无关紧要。只需将 iframe 放入一些流畅的元素中,例如 CSS 网格布局中的单元格。
(包括来自:http ://updateox.com/web-design/make-facebook-comment-and-like-box-fluid-width/ 的想法)