2012-09-12 50 views
1

我對開發很陌生(這是我的第一個項目,我正在學習),所以可能有一個非常簡單的答案!在HTML頁面中移動swf對象

我正在爲使用Appmobi XDK編寫的HTML格式的電臺創建一個android應用程序。該電臺使用shoutcast地址,但我知道android正在努力解決這個問題,所以我將shoutcast IP嵌入到我在網上找到的Flash播放器模板div中。然而,我不能讓div在HTML頁面上改變位置,它總是停留在左上角或者消失。我嘗試使用TOP:LEFT等樣式,並使用align:center,這兩者都不起作用。所以我想知道有沒有人知道我可以如何將它移動到我想要的頁面上。

我已經提供了下面的div和代碼的HTML。如果有人知道如何解決這個問題,我會非常感激!謝謝!

"<div id="container"> <a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player. 
<a href="http://www.shoutcheap.com/shoutcast/">shoutcast server hosting</a> 
<a href="http://www.shoutcheap.com/icecast/">icecast server hosting</a></div> 
<script type="text/javascript" src="http://www.shoutcheap.com/flashplayer/swfobject.js"></script> 
<script type="text/css" style= "TOP:700; LEFT:250; "> 
var s1 = new SWFObject("http://www.shoutcheap.com/flashplayer/player.swf" , 
"ply","250","50","9","#FFFFFF"); 
s1.addParam("allowfullscreen","true"); 
s1.addParam("allowscriptaccess","always"); 
s1.addParam("flashvars", 
"file=http://50.7.244.222:10074/;stream.nsv&type=mp3&volume=50&autostart=true"); 
s1.write("container");" 

回答

0

試試這個爲你的風格

position: absolute; 
left: 50%; 
top: 700px; // distance from the top of the page 
margin-left: -125px; // subtract half the width of the document to align center