Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up twitter's embedded timeline width in percentage (responsive/fluid design)

I'm looking to set up twitter's embedded timeline, it's quite easy when you're having a fixed design, but that's not my case and I'm actually building a fluid and responsive design for a new website.

My question is, how can I set up twitter's embedded timeline with a fluid width since its an iframe and you're supposed to set up the with in px in your twitter account ?

Thanks :)

like image 691
Miles M. Avatar asked Sep 09 '12 19:09

Miles M.


People also ask

How do I change the size of an embedded tweet?

The Embed Tweet feature is really meant to be used inline within articles and not in contexts like sidebars. As such, there are no width adjustments available. That being said, embedded Tweets do narrow themselves down a bit if you stick them in a smaller containing block. Looks like they shrink down to about 252px.

How do I customize my twitter feed?

In the top menu, tap the icon. Tap the arrows to switch to the timeline view of your choice, or tap View content preferences to go to your settings. In the top menu, tap the icon. Tap the arrows to switch to the timeline view of your choice, or tap View content preferences to go to your settings.


1 Answers

This seems to work for me:

  #twitter-widget-0 {
    width:100%;
  }

where #twitter-widget-0 is the iframe it generates, placed in an appropriately-styled container. It's not perfect: the widget generates its contents a bit differently depending on width, and margins, etc. won't be exactly the same after resizing; but this seems minor.

I'm curious as to why simple CSS didn't work for you - sorry if I'm missing something.

like image 134
Lack Avatar answered Nov 09 '22 05:11

Lack