3

我一直在我的图书馆管理系统中使用 twitter 小部件。我想减少 twitter 小部件的最小高度,因为它的最小高度不小于 250 像素。我想要它更小。我将如何通过 css 做到这一点?

这是小部件代码,我从 twitter 获得:

<a class="twitter-timeline"  href="https://twitter.com/vhakhikhang" data-widget-id="520463403060432896">
    Tweets by @vhakhikhang
</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>
4

2 回答 2

3

.stream对我不起作用,但以下是。

iframe.twitter-timeline {
    height: 50px !important;
}

它只是选择在您的页面上生成的 iframe twitter 上的类并覆盖它在 iframe 上的 height 元素。

于 2014-10-16T21:13:30.230 回答
1

使用以下 CSS,添加您想要使用的大小!important

.stream {
height: 50px !important;
}

!important声明将帮助您覆盖 Twitter API 提供的正常 CSS 特性。

于 2014-10-13T07:35:24.893 回答