【发布时间】:2011-01-05 14:15:17
【问题描述】:
我试图在 iframe 中嵌套框架集,但无法让框架集的背景在 IE 中显示为透明。 Firefox 显示正确。
这是 iframe:
<iframe src="frameset.html" name="myframe" width="500" height="500" frameborder="0" allowtransparency="true"></iframe>
这是 框架集.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>
【问题讨论】:
-
你试过给
frameset一个background-color: transparent吗? -
除非你有充分的理由不这样做,否则几乎所有的框架属性都应该移动到 css 文件或至少是样式标签。在这种情况下,您将使用 style="background-color: transparent" 来获得透明度。
-
我已经尝试了所有这些。如果我从 frameset.html 文档中删除框架集,透明度就会起作用。问题在于框架集本身。
-
你找到解决办法了吗?
标签: html iframe internet-explorer transparent frames