怎么让DIV层浮动到flash上面?

实很简单:就是给flash添加透明参数,简单的问题,在一些网站上洋洋洒洒写那么长,很扯淡。
问题的关键就在下面横线之间的两句,最核心的 代码就是 name="wmode" value="transparent" 就是用来让flash透明的。

透明flash也是这样做的,然后就是用和定位其他的DIV没什么两样了,比如你可以用绝对定位,配合相对定位就搞定了。

<embed  这一句是为了兼容火狐

---------------------------------
 <param name="wmode" value="transparent" />
    <embed src="
我是flash.swf" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="500" height="220"></embed>

-----------------------------------
下面是一个示例:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>
怎么让DIV层浮动到flash上面?- 懒人建站 http://www.51xuediannao.com</title>
<style type="text/css">
<!--
body {
 margin:0;
 padding:0;
 font-size:12px;
}
#flash {
 margin:20px auto 0 auto;
 500px;
 height:220px;
 position:relative;
}
#nav {
 position:absolute;
 right:50px;
 top:30px;
 400px;
 line-height:30px;
 text-align:center;
 font-weight:bold;
 background:#f00;
 border:1px solid #fff;
}
#nav a {
 color:#fff;
}
#nav a:hover {
 color:#ff0;
}
-->
</style>
</head>

<body>
<div id="flash">
  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="500" height="220">
    <param name="movie" value="
我是flash.swf" />
    <param name="quality" value="high" />
 <param name="wmode" value="transparent" />
    <embed src="
我是flash.swf" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="500" height="220"></embed>
  </object>
  <div id="nav"><a href=http://51xuediannao.com/js title="JS
代码">这是浮动层</a></div>
</div>

</body>
</html>

如果这篇文章对您有帮助,您可以打赏我

技术交流QQ群:15129679

原文地址:https://www.cnblogs.com/yeminglong/p/2212989.html