HTML Embed object has a grey background. Can it be transparent?

落爺英雄遲暮 提交于 2019-12-11 02:56:45

问题


I'm using Firefox with an opensource plugin to playback video. The video is scaled "as good as possible" to fit the available space defined in the width and height of the embed object. But sometimes there is a little grey border on the right and/or bottom.

It seems this isn't the bgcolor of my parent div as changing it has no effect at all.

This is the HTML:

<div id="videoHolder" style="position: absolute; left: 50px; top: 50px; width: 300px; height: 150px;">
 <embed id="player" width="300" height="150" border="0" type="application/x-gbp" x-gbp-uri="">
</div>

Anyone knows of a way to define an embed to be transparent? Setting wmode=transparent as with Flash has no effect...

Thanks, Frank


回答1:


There is no general way to tell plugin elements to be transparent from the browser-side, plugins need to support that themselves in their native code.

For Flash setting the wmode="transparent" works, but only because Flash implements that itself.




回答2:


Try adding the "wmode" attribute and setting it's value to "transparent":

<div id="videoHolder" style="position: absolute; left: 50px; top: 50px; width: 300px; height: 150px;">
    <embed WMODE="transparent" id="player" width="300" height="150" border="0" type="application/x-gbp" x-gbp-uri="">
</div>


来源:https://stackoverflow.com/questions/12261216/html-embed-object-has-a-grey-background-can-it-be-transparent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!