我已经阅读了很多关于make flash作为标题背景的教程,但是那里有几个代码。你能解释一下如何将flash作为背景吗?
答案 0 :(得分:1)
你必须创建两个完全在同一个地方的div。然后,将您的Flash内容放在div 1中,将您想要的内容放在div 2中的“顶部”。
<div id="holder">
<div id="flash_header_background">FLASH HERE</div>
<div id="header_foreground">CONTENT HERE</div>
</div>
然后用CSS设置div的样式,使它们相互叠加。
#holder {
height: 250px; /* Flash height */
width: 800px; /* Flash width */
position: relative;
}
#flash_header_background {
z-index: 1;
position: absolute;
height: 100%;
width: 100%;
}
#header_foreground {
z-index: 2; /* Puts this div above the background DIV */
position: relative;
height: 100%;
width: 100%;
}
重要提示:请务必将Flash内容的wmode
设置为opaque
或transparent
。 - 谢谢你提醒
答案 1 :(得分:1)
将Flash媒体作为背景(即能够在其上放置内容)所涉及的最重要因素是确保在嵌入时,您将wmode
设置为opaque
或transparent
。如果不这样做,将意味着无论如何,媒体都会在页面上呈现其他元素。
除此之外,您只需使用CSS通过position: absolute;
在媒体上放置内容,并可能为z-index
分配更高的值。