如何将embed标签的大小强制为div标签的大小?

时间:2014-11-06 22:56:19

标签: html css

如何将embed标签的大小强制为div标签的大小,我可以将embed标签的大小更改为与div标签相同但我想获得embed标签的完全重新标记(使用embed标签)对于摄像头)

<div style="background-color: #111; width: 80%; height:500px; margin-left: auto; margin- ight: auto; ">      

<embed id="webcam_movie" wmode="Transparent" src="../Scripts/webcam.swf" loop="false" menu="true" quality="best" bgcolor="#ffffff" name="webcam_movie" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="shutter_enabled=1&amp;shutter_url=../Scripts/shutter.mp3&amp;width=800&amp;height=600&amp;server_width=800&amp;server_height=600" height="600" width="800" align="middle">  

</div>

2 个答案:

答案 0 :(得分:1)

你可以使用这个技巧包嵌入div并定义css规则

    <head>
    <style>
    .flash-container {
        height: 0;
        overflow: hidden;
        padding-bottom: 56.25%;
        padding-top: 30px;
        position: relative;
    }
    .flash-container embed {
        height: 100%;
        left: 0;
        position: absolute;
        top: 0;
        width: 100%;
    }
    </style>
    </head>
    <body>
    <div class="flash-container" style="background-color: #111; width: 80%; height:500px; margin-left: auto; margin-right: auto; ">      

    <embed id="webcam_movie" wmode="Transparent" src="../Scripts/webcam.swf" loop="false" menu="true" quality="best" bgcolor="#ffffff" name="webcam_movie" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="shutter_enabled=1&amp;shutter_url=../Scripts/shutter.mp3&amp;width=800&amp;height=600&amp;server_width=800&amp;server_height=600" height="600" width="800" align="middle">  

    </div>
    </body>

答案 1 :(得分:0)

试试看:

http://soundscreen.com/qt_webmasters/fullscreen.html

http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS44B1892B-1668-4a80-8431-6BA0F1947766.html

另请参阅 allowfullscreen =&#34; false&#34; - &gt; allowfullscreen =&#34; true&#34; 选项。

希望这有帮助。