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

后端 未结 9 1316
慢半拍i
慢半拍i 2021-02-04 17:06

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 responsi

9条回答
  •  梦如初夏
    2021-02-04 17:29

    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.

提交回复
热议问题