1

我正在尝试将框架集嵌套在 iframe 中,但无法让框架集的背景在 IE 中显示为透明。Firefox 显示正确。

这是 iframe:

<iframe src="frameset.html" name="myframe" width="500" height="500" frameborder="0" allowtransparency="true"></iframe>

这是 Frameset.html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>

<frameset cols="21%,*" framespacing="0" border="0" frameborder="no">
<frame name="menu" src="test.html" scrolling="no" marginwidth="0" marginheight="0" noresize="noresize" frameborder="no" style="background: transparent" allowtransparency="true">
<frame name="main" src="test.html" marginwidth="0" marginheight="0" noresize="noresize" frameborder="no" style="background: transparent" allowtransparency="true">
</frameset>

</html>
4

2 回答 2

5

我最近了解到 IE 浏览器有一个非标准的 iframe 代码:allowTransparency="true"

把它放在你的 iframe 中并将样式背景设置为透明,你应该没问题。

于 2011-11-09T11:41:40.727 回答
3

仍然没有人有任何答案......除了 IE 作为浏览器引擎完全被破坏了。即使在今天,IE8 和 IE9 也即将问世。我讨厌 IE。我希望所有用户都将它转储到真正的浏览器,如 Firefox 或 Opera。

于 2010-08-11T00:49:04.643 回答