【问题标题】:Transparent frameset in iframe ie white backgroundiframe 中的透明框架集,即白色背景
【发布时间】: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


【解决方案1】:

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

【讨论】:

  • 8 年后,IE 仍然很烂。
【解决方案2】:

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

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

【讨论】:

  • Brilliant - 这解决了我在 IE8 中遇到的相同问题
猜你喜欢
  • 2014-08-21
  • 2013-04-03
  • 2021-09-20
  • 2015-06-22
  • 2019-01-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-03-27
相关资源
最近更新 更多