在网页制作中,flash是不能直接作为网页的背景的。没有相关的设置可以直接操作。因此,我们需要换一个策略:
是否还记得“层”的概念,我们在这里就要运用到这个概念。在我们的网页层上面在新建一个层。在这个层中插入flash,但注意,插入flash后,会遮挡下面网页层相应的位置,因此,我们需要将flash透明化,以达到让网页层的内容正常显示的目的。
而本质是,插有flash的层是在网页层的上面的。“背景”,是相对而言的。以下是html代码:
html
head
meta http-equiv=Content-Type content=text/html; charset=gb2312
meta name=GENERATOR content=Microsoft FrontPage 4.0
meta name=ProgId content=FrontPage.Editor.Document
titleNew Page 2/title
/head
body
//这一段就是flash做网页背景,实际上是建了一个层,又将flash透明化。
而本质是这个层实际上在其他层之上,但由于flash透明化了,因此看上去像背景。
div id=Layer1 style=position:absolute; left:0; top:0; width:700; height:500; z-index:1
div align=center
embed src=all_images/对2.swf width=700 height=500 wmode=transparent
/div
/div
div id=Layer2 style=position:absolute; left:0; top:0; width:700; height:500; z-index:2/div
//从这里开始就是常规网页制作的代码。
/body
/html
注意,带有“//”的中文是老师的注解,不是html代码的内容,复制代码时不要复制这些中文。
flash的路径要根据实际情况修改
这个不算是做背景 算是一个技巧
如果你对层应用的好的话
你可以在背景中设置为默认社.然后新见2个层. 底部的层放flash .上面的层可以放html代码.但层的固定不容易.多摸索吧
取消
评论