JS Twitter 小部件总是创建新的换行符,需要在同一行
我需要以下 JS Twitter 小部件与“TEST MESSAGE”文本显示在同一行,但是它总是创建换行符,并且此代码显示为三行。
TEST MESSAGE<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 10,
interval: 30000,
width: 370,
height: 500,
theme: {
shell: {
background: '#333333',
color: '#ffffff'
},
tweets: {
background: '#e8e8e8',
color: '#000000',
links: '#005eff'
}
},
features: {
scrollbar: false,
loop: true,
live: false,
hashtags: true,
timestamp: true,
avatars: false,
behavior: 'default'
}
}).render().setUser('ControllerShop').start();
</script>TEST MESSAGE
I need the following JS Twitter widget to appear on the same line as the "TEST MESSAGE" texts, however it always creates a line break and this code appears as three lines.
TEST MESSAGE<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 10,
interval: 30000,
width: 370,
height: 500,
theme: {
shell: {
background: '#333333',
color: '#ffffff'
},
tweets: {
background: '#e8e8e8',
color: '#000000',
links: '#005eff'
}
},
features: {
scrollbar: false,
loop: true,
live: false,
hashtags: true,
timestamp: true,
avatars: false,
behavior: 'default'
}
}).render().setUser('ControllerShop').start();
</script>TEST MESSAGE
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Twitter 小部件呈现为
,它是一个块元素,因此默认情况下以这种方式运行(就像任何其他块元素,例如
或
<块引用>
)。要使其与文本内联显示,请尝试:您可以在在此小提琴中中看到它的实际效果(确保“结果”窗格足够宽以容纳所有内容)。
目前还不清楚你为什么要这样做,所以我对你更大的用例很好奇,但无论如何这都能完成工作。
The Twitter widget renders as a
<div>
, which is a block element and so behaves this way by default (just like any other block element like<p>
or<blockquote>
). To make it display inline with the text try:You can see it in action in this fiddle (make sure the "Result" pane is wide enough to accommodate everything).
It's not really clear why you'd want to do this so I'm curious about your larger use case, but this does the job anyway.