Twitter底部被切断

时间:2014-07-31 09:03:18

标签: html css twitter

我遇到了嵌入式Twitter Feed底部被切断的问题,我无法理解为什么会这样。我用

嵌入它
<div class="twitterdiv">
       <a class="twitter-timeline" href="https://twitter.com/xxx" data-widget-id="458185945217388544" height="400" data-link-color="#532427">Tweets by @xxx</a>
       <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>

在css中只是

.twitterdiv
{
     height: 400px;
}

但是我应该提一下,这是放在一个宽度固定的外部div中。奇怪的是,当我在控制台中通过css时,我看到框架的宽度设置为外部div的宽度,如果我禁用该属性并再次启用它,则显示确定。

How it is

How it should be

想法?

由于

2 个答案:

答案 0 :(得分:0)

您可以尝试将CS​​S更改为

.twitterdiv {
height:500px;
width:500px;
}

或正如您所提到的

.twitterdiv {
height:320px;
width:320px;
} 

如果这对您不起作用,请告诉我,如果没有,那么我会尝试为您解决。

答案 1 :(得分:0)

我也有这个问题。根据{{​​3}},您可以直接设置宽度和高度。默认情况下,它设置为400.尝试在调用窗口小部件时将height="425"添加到a标记:

<a class="twitter-timeline"
  height="425"
  href="https://twitter.com/twitterdev"
  data-widget-id="YOUR-WIDGET-ID-HERE">
Tweets by @twitterdev
</a>

这为我解决了。

相关问题