最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Dynamically resize Facebook Like Box - responsive change of data-width="{n}" - Stack Overflow

programmeradmin0浏览0评论

The Facebook code:

<div class="fb-like-box" data-href="/" data-width="160" data-height="100" data-colorscheme="light" data-show-faces="false" data-header="false" data-stream="false" data-show-border="false"></div>

I am trying to change data-width="{n}" and/or data-height="{n}" dynamically on screen size change (smartphone/tablet orientation change) using either javascript or CSS media queries.

The Facebook code:

<div class="fb-like-box" data-href="http://stackoverflow./" data-width="160" data-height="100" data-colorscheme="light" data-show-faces="false" data-header="false" data-stream="false" data-show-border="false"></div>

I am trying to change data-width="{n}" and/or data-height="{n}" dynamically on screen size change (smartphone/tablet orientation change) using either javascript or CSS media queries.

Share Improve this question asked Dec 29, 2013 at 17:01 YatkoYatko 8,8059 gold badges43 silver badges50 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 10

Try adding this to your css code:

.fb-ments, .fb-ments iframe[style], .fb-like-box, .fb-like-box iframe[style] {width:  100% !important;display:block;z-index:2000;position:relative}
.fb-ments span, .fb-ments iframe span[style], .fb-like-box span, .fb-like-box iframe  span[style] {width: 100% !important;display:block;z-index:2000;position:relative}

Hope it helps..

发布评论

评论列表(0)

  1. 暂无评论