我正在为我的网站做一个抽动页面,我需要帮助如何使它有一个twitch.tv播放器在一边,另一边的twitch.tv聊天。我试过这个:
<div align="left">
<object type="application/x-shockwave-flash" height="500" width="900" id="live_embed_player_flash" data="http://www.twitch.tv/widgets/live_embed_player.swf?channel=clodbegamingnetwork" bgcolor="#000000">
<param name="allowFullScreen" value="true" />
<param name="allowScriptAccess" value="always" />
<param name="allowNetworking" value="all" />
<param name="movie" value="http://www.twitch.tv/widgets/live_embed_player.swf" />
<param name="flashvars" value="hostname=www.twitch.tv&channel=clodbegamingnetwork&auto_play=true&start_volume=25" />
</object>
<div align="right">
<iframe frameborder="0" scrolling="no" src="http://twitch.tv/clodbegamingnetwork/chat?popout=" height="500" width="350">
</iframe>
</div>但是它不起作用。它是这样做的:
http://prntscr.com/48xiuh
(我缩小了)
所以有人会帮我解决这个问题。我似乎想不出这是怎么回事。
我希望别名的外观示例(忽略twitch player底部的标题):http://prntscr.com/48xjj2
谢谢!
发布于 2014-08-03 06:19:27
object和iframe元素都被定位为block,这意味着它们是唯一使用“行”中的整个空间的元素。为了允许两个元素并排,您可以将object包装在div中,然后执行以下操作:
#object-div {
float: left;
}
iframe {
float: right;
}通过这样做,这两个元素将共享同一行。您还可以通过执行以下操作将这些block元素转换为inline元素:
#object-div, iframe {
display: inline-block;
}但是那个will only work from IE8 and up。
发布于 2015-06-25 17:33:04
<iframe style="width: 620px; height: 378px;" scrolling="no" frameborder="0" src="twitch url here/embed"></iframe><iframe style="width: 350px; height: 379px;" scrolling="no" frameborder="0" src="twitch url here/chat?popout="></iframe>
<center>
<a href="twitch url here?tt_medium=live_embed&tt_content=text_link" style="padding: 2px 0px 4px; width: 345px; font-size: 10px; font-weight: normal; text-decoration: underline; display: block;">Watch live video from (twitch user name here) on www.twitch.tv</a>
</center>
<iframe style="width: 620px; height: 378px;" scrolling="no" frameborder="0" src="twitch url here/embed"></iframe><iframe style="width: 350px; height: 379px;" scrolling="no" frameborder="0" src="twitch url here/chat?popout="></iframe>
<a href="twitch url here?tt_medium=live_embed&tt_content=text_link" style="padding: 2px 0px 4px; width: 345px; font-size: 10px; font-weight: normal; text-decoration: underline; display: block;">Watch live video from (twitch user name here) on www.twitch.tv</a>
发布于 2016-01-12 23:54:47
我根据你的回答做了这件事,并让它起作用了!我的代码如下...
CSS
#stream { width: 75%; float: left; }
#chat { width: 25%; float: right }HTML
<section align="center">
<h1>My LiveStream</h1>
</section>
<section>
<div class="stream" align="center">
<object type="application/x-shockwave-flash" height="500" width="900" id="live_embed_player_flash" data="http://www.twitch.tv/widgets/live_embed_player.swf?channel=clodbegamingnetwork"
bgcolor="#000000">
<param name="allowFullScreen" value="true" />
<param name="allowScriptAccess" value="always" />
<param name="allowNetworking" value="all" />
<param name="movie" value="http://www.twitch.tv/widgets/live_embed_player.swf" />
<param name="flashvars" value="hostname=www.twitch.tv&channel=clodbegamingnetwork&auto_play=true&start_volume=25" />
</object>
<iframe frameborder="0" scrolling="no" src="http://twitch.tv/clodbegamingnetwork/chat?popout=" height="500" width="350">
</iframe>
</div>
</section>https://stackoverflow.com/questions/25099507
复制相似问题