Facebook就像按钮框打开窗外区域

时间:2012-08-18 20:28:55

标签: html css facebook

我的网站底部有一个类似Facebook的按钮。当我点击它时,我可以输入评论的“框”在我的网络浏览器窗口之外,我无法向下滚动或类似的东西(见下面的截图 - 图像的底部是窗口的底部)。我怎样才能解决这个问题? (即,使框出现在按钮上方)。 TKS

enter image description here

HTML

  <div id="social">
    <div class="fb-like" data-href="http://mydomain.com" data-send="false" data-layout="button_count" data-width="106" data-show-faces="false" data-font="verdana"></div>
    <a href="https://twitter.com/share" class="twitter-share-button" data-lang="msa">Tweet</a> 
    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> 
  </div>

CSS:

#footer {
    position: fixed;
    bottom: 0;
    color: #333;
    left: 0;
    z-index: 999;
    width: 96%;
    text-align: right;
    padding: 30px 2%;
    vertical-align: bottom;
}
#social {
    position: absolute;
    vertical-align: middle;
    left: 2%;
    color: #333;
}

.fb_iframe_widget, iframe.twitter-share-button {
    display: inline-block;
    vertical-align: middle;
}
span.languageselector {
    display: inline-block;
    height: 20px; /* same height as #social div */
    line-height: 20px; /* same as line-height */
}

3 个答案:

答案 0 :(得分:1)

实际上有一个讨厌的解决方案。我不认为这是合法的。但如果它非常重要,你可以覆盖facebook css。在你的情况下,这样的事情就可以解决问题。

.fb-like.fb_edge_widget_with_comment.fb_iframe_widget span iframe {

/* Now you can apply css here */
bottom:0!important;
}

如果您想启用发送按钮,可以使用,

对于浅色方案:

.fb_edge_comment_widget.fb_send_button_form_widget.light.fb_iframe_widget {

/********css code here*******
*Ex:    
position: fixed!important;
bottom: 20px!important;
top: initial!important;
*/
}

对于暗色方案:

.fb_edge_comment_widget.fb_send_button_form_widget.dark.fb_iframe_widget {

/********css code here*******/

}

我再说一遍,这不是一个合适的解决方案。所以不要使用它,除非它非常重要。请记住,这些课程可以更改,并不适合每个场合。

答案 1 :(得分:1)

我遇到了同样的问题。我能够通过删除属性来修复它

overflow:auto

来自父元素

答案 2 :(得分:0)

Like 按钮嵌入固定和绝对定位的容器中是一种常见的问题。在您的情况下,最简单的解决方案是在页面中向上移动类似按钮。您无法强制评论框弹出向上而不是向下