0

我已经阅读了很多关于将 flash 作为标题背景的教程,但是其中涉及到一些代码。你能解释一下如何使闪光灯作为背景吗?

4

2 回答 2

1

The single most important element involved in making flash media a background (i.e. being able to place stuff ontop of it) is to ensure that when embedding, you're setting the wmode to opaque or transparent. Failing to do so will mean that no matter what, the media will render ontop of the other elements on the page.

Other than that, you just need to use CSS to place content over the media via position: absolute; and possibly allocating a higher value for z-index.

于 2012-05-18T09:04:57.297 回答
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%;
}

重要提示:请记住将wmodeFlash 内容的 设置为opaquetransparent。- 谢谢strah提醒

于 2012-05-15T18:52:23.733 回答