我正在尝试使用CSS来定位我的Flex应用程序,但它无法正常工作

时间:2010-05-24 07:29:28

标签: html css flex flex4

我正在尝试定位我的Flex应用程序,使其在垂直方向的底部为40%,在水平方向的左侧为70%。这是我在CSS中定义flash部分的方法:

#flashContent { display:none;position:absolute; top:60%;width:70%;height:40%;}

这是HTML:

<div id="flashContent">
            <p>
                To view this page ensure that Adobe Flash Player version 
                10.0.0 or greater is installed. 
            </p>
            <script type="text/javascript"> 
                var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://"); 
                document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" 
                                + pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" ); 
            </script> 


    <noscript>
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="434" height="100%" id=app name>
            <param name="movie" value=link_to_the_file />
            <param name="quality" value="high" />
            <param name="bgcolor" value="#ffffff" />
            <param name="allowScriptAccess" value="sameDomain" />
            <param name="allowFullScreen" value="true" />
            <!--[if !IE]>-->
            <object type="application/x-shockwave-flash" data=link_to_the_file width="434" height="100%">
                <param name="quality" value="high" />
                <param name="bgcolor" value="#ffffff" />
                <param name="allowScriptAccess" value="sameDomain" />
                <param name="allowFullScreen" value="true" />
            <!--<![endif]-->
            <!--[if gte IE 6]>-->
                <p> 
                    Either scripts and active content are not permitted to run or Adobe Flash Player version
                    10.0.0 or greater is not installed.
                </p>
            <!--<![endif]-->
                <a href="http://www.adobe.com/go/getflashplayer">
                    <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
                </a>
            <!--[if !IE]>-->
            </object>
            <!--<![endif]-->
        </object>
    </noscript> 
</div>  

但它仍然只是出现在左上角。我做错了什么?

感谢阅读。

1 个答案:

答案 0 :(得分:0)

嘿,plzz不要在flex中使用百分比值,如果你想把你的东西放在中心,那么我们有horizo​​ntalAlign,而对于垂直,我们有verticalAlign属性,

plzz仅提及左,上,下,右数字,

我希望这有帮助,