3

I have been using twitter widget in my library management system. I want to reduce the twitter widget's ,minimum height since it's minimum height is not less than 250 px. I want it more smaller. How will I do that through css?

This is the widget code, I got from 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>

2 Answers2

3

.stream didn't work for me, but the following did.

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

It just selects the class on the iframe twitter generates on your page and overrides it's height element on the the iframe.

Mint
  • 14,388
  • 30
  • 76
  • 108
1

Use the following CSS, add the size you want using !important

.stream {
height: 50px !important;
}

!important declarations will helps you to override the normal CSS specificity providing by Twitter API.

GibboK
  • 71,848
  • 143
  • 435
  • 658