我想在Default.aspx页面中显示一个flash文件。 当我使用html文件时,flash覆盖整个页面,这是Html源代码:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>home</title>
</head>
<body bgcolor="#d3d3d3" style="margin:0px;">
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="100%" id="home" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="home.swf" /><param name="menu" value="false" />
<param name="quality" value="High" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#d3d3d3" />
<embed src="../swf/home.swf" menu="false" quality="High" wmode="transparent" bgcolor="#d3d3d3" width="100%" height="100%" name="home" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</noscript>
</body>
</html>
但是当我把它放在我的default.aspx文件中时,它的高度不会影响整个页面。 这是我的default.aspx源文件:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="UI_Default" %>
<!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 runat="server">
<title></title>
</head>
<body bgcolor="#d3d3d3" style="margin:0px;">
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="100%" id="home" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="home.swf" /><param name="menu" value="false" />
<param name="quality" value="High" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#d3d3d3" />
<embed src="../swf/home.swf" menu="false" quality="High" wmode="transparent" bgcolor="#d3d3d3" width="100%" height="100%" name="home" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</noscript>
</body>
</html>
出了什么问题?
答案 0 :(得分:1)
在XHTML中,body
元素不是那么神奇,并且不必像窗口一样高。
将html
和body
元素的高度设置为100%
,并设置margin
的{{1}}和padding
element(因为某些浏览器有默认填充而不是边距):
body