【问题标题】:Twitter bottom cut off推特底部被切断
【发布时间】:2014-09-23 03:49:28
【问题描述】:

我遇到了嵌入式 Twitter 提要底部被切断的问题,我不明白为什么会这样。我正在嵌入它

<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 的宽度,如果我禁用该属性并再次启用它,则显示正常。

想法?

谢谢

【问题讨论】:

    标签: html css twitter


    【解决方案1】:

    您可以尝试将 CSS 更改为

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

    或者如你所说的

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

    如果这对你不起作用,请告诉我,如果不是,我会尽力为你解决。

    【讨论】:

      【解决方案2】:

      我也有这个问题。根据Twitter developer docs for embedded timelines,您可以直接设置宽度和高度。默认情况下,它设置为 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>
      

      这为我解决了问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-02-21
        • 1970-01-01
        • 2016-02-03
        • 1970-01-01
        • 1970-01-01
        • 2020-04-27
        • 2018-04-13
        • 2018-12-06
        相关资源
        最近更新 更多