Twitter Width problems

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Twitter Width problems

Post by simonmlewis »

Hi

We have a Twitter feed on various homepages. They are normally set to either 100% wide, that stretches to fit a narrow mobile, or 350px wide.

But now we want our feeds to be 100% width of our desktop screens. Facebook is easy. Blog is easy. But Twitter seems to force it to be 520px max.

I've seen various methods of CSS to overcome this. But none work.
These are two options.

Code: Select all

      width: 100% !important; 
    }
    
#twitter-widget-0 { 
      width: 950px;
    }
Reading the Twitter help pages, it seems it cannot be done as the max is 520 (goodness knows why).

So is the definitive answer that they have oddly stopped it goes wider? OR can it actually be done?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Twitter Width problems

Post by Celauran »

You're asking us to help you style invisible markup.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Twitter Width problems

Post by simonmlewis »

It's just the Widget code:

Code: Select all

  <a class=\"twitter-timeline\"  href=\"https://twitter.com/---\" data-widget-id=\"---\"  height=\"200\">Tweets by @---</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>
So if I put in width=\"100%\" it doesn't work.
And the CSS I posted doesn't do it.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
Post Reply