我有一箇中心p
,我用它來握住我的嵌入式實時流對象,像這樣中心屏幕上的物體移除一個iframe
用於聊天的iframe現在以後,我有一個JQuery
調用隱藏聊天, <a id="hidechat" onClick="$('#chat_embed').hide();" href="#">[Hide Chat]</a>
但是,隨着流盒最終被拉斷的方式向左側
我很想讓聊天在屏幕中心重新對齊,而沒有右側的醜陋框。我試過設置一個float:left;
,但是它下方的文字環繞並且通常會打破整個佈局。
這可能與我目前的佈局?
CSS:
p
{
margin-left:auto;
margin-right:auto;
margin-bottom:1%;
background-color:#121212;
max-width:53%;
max-height:75%;
padding-top:25px;
padding-left:25px;
padding-right:25px;
padding-bottom:25px;
}
p.streamblock
{
padding-top:25px;
padding-left:25px;
padding-right:25px;
padding-bottom:25px;
max-width:1000px;
}
嵌入代碼:
<object type="application/x-shockwave-flash" height="378" width="620" id="live_embed_player_flash" data="http://www.twitch.tv/widgets/live_embed_player.swf?channel=mychannel" bgcolor="#000000">
<param name="movie" value="http://www.twitch.tv/widgets/live_embed_player.swf" />
<param name="flashvars" value="hostname=www.twitch.tv&channel=mychannel&auto_play=true&start_volume=25" />
</object>
<iframe frameborder="0" scrolling="no" id="chat_embed" src="http://twitch.tv/chat/embed?channel=tronasaurusx&popout_chat=true" height="378" width="350"></iframe>
無論是'object'和'iframe'標籤有固定的尺寸。 CSS可能會有幫助。有沒有機會看到你的代碼在行動? – approxiblue 2012-07-16 03:24:20
當然,您可以在[tronasaurus.com](http://www.tronasaurus.com/) – 2012-07-16 03:24:57
查看它。只需將'text-align:center'添加到'p.streamblock'。另外,考慮將您的顯示/隱藏鏈接的href更改爲javascript:void(0);'。詳情在這裏:http://stackoverflow.com/questions/134845/href-tag-for-javascript-links-or-javascriptvoid0。 – approxiblue 2012-07-16 03:53:40