将嵌入的tweet强制为100%宽度 [英] Forcing embedded tweet to 100% width

查看:191
本文介绍了将嵌入的tweet强制为100%宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过将嵌入式tweet的宽度设置为100%来强制嵌入式tweet的响应行为。

I'm trying to force an embedded tweet to behave responsively by setting its width to 100%.

我已尝试按如下方式调整内联宽度:

I've attempted adjusting the width inline as follows:

<blockquote class="twitter-tweet" width="100%">...</blockquote>

我也尝试了如下的twitter-tweet类样式:

I've also attempted styling the twitter-tweet class as follows:

blockquote.twitter-tweet {width:100% !important}

两种方法都失败了。这是否只是被脚本覆盖Twitter需要包含在tweet嵌入? (脚本可以在 http://platform.twitter.com/widgets.js 中引用。 )

Both approaches have failed. Is this simply being overwritten by the script Twitter requires to be included with the tweet embed? (The script can be referenced at http://platform.twitter.com/widgets.js.)

任何帮助强制嵌入到100%宽度将非常感激。

Any help in forcing the embed to 100% width would be very much appreciated.

推荐答案

Cory,这是不可能使用Twitter的提供的嵌入。嗯,有可能在一定程度上,但只有520px。请参见 https://dev.twitter.com/docs/embedded-timelines

Cory, this is not possible using Twitter's provided embed. Well, it's possible to some extent, but only up to 520px. See https://dev.twitter.com/docs/embedded-timelines.

但是,您可以像这样添加width =2000:

However, you can add width="2000" like this `

<a class="twitter-timeline" width="2000" href="https://twitter.com/twitterapi" data-widget-id="YOUR-WIDGET-ID-HERE">Tweets by @twitterapi</a>

`
然后调整CSS。但这不是最好的解决方案。

` And then adjust your CSS. It's not the best solution, though.

有一个老帖子可能对你有用,不知道是否仍然有效,但值得一看,在 http://kovshenin.com/2012/ quick-tip-how-to-make-tweet-embeds-responsive /

there's an old post that might be of use for you, don't know if still works, but worth a view, check it out at http://kovshenin.com/2012/quick-tip-how-to-make-tweet-embeds-responsive/

这篇关于将嵌入的tweet强制为100%宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆