1

我对开发很陌生(这是我的第一个项目,我正在学习)所以可能有一个非常简单的答案!

我正在为广播电台创建一个 android 应用程序,使用 Appmobi XDK 用 HTML 编写。该电台使用了一个直播地址,但我知道 android 很难处理这个问题,所以我将直播 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");"
4

1 回答 1

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
于 2012-09-12T18:53:43.773 回答