1.与 iframe 元素一起使用的 allowTransparency 标签属性必须设置为 true。
2.在 iframe 内容源文档,background-color 或 body 元素的 bgColor 标签属性必须设置为 transparent。
具体步骤: 1. 包含框架页的代码。
<body bgColor="#eeeeee">
<iframe allowTransparency="true" src="transparent.htm">
</iframe>
2.transparent.htm页的代码。
<body bgColor="transparent">
特别说明
本例主要是iframe对象的allowTransparency属性应用,在该属性设置为true并且iframe所载加页的背景颜色设置为transparent(透明)时iframe将透明化。
allowTransparency设置或获取对象是否可为透明。
bgColor 设置或获取对象的背景颜色。
2.在 iframe 内容源文档,background-color 或 body 元素的 bgColor 标签属性必须设置为 transparent。
具体步骤: 1. 包含框架页的代码。
<body bgColor="#eeeeee">
<iframe allowTransparency="true" src="transparent.htm">
</iframe>
2.transparent.htm页的代码。
<body bgColor="transparent">
特别说明
本例主要是iframe对象的allowTransparency属性应用,在该属性设置为true并且iframe所载加页的背景颜色设置为transparent(透明)时iframe将透明化。
allowTransparency设置或获取对象是否可为透明。
bgColor 设置或获取对象的背景颜色。
本文介绍如何使用allowTransparency属性使iframe元素实现透明效果。主要内容包括:1. 在包含iframe的页面中设置allowTransparency为true;2. 在iframe加载的内容源文档中设置背景颜色为transparent。通过这些步骤可以实现iframe背景的完全透明。

6717

被折叠的 条评论
为什么被折叠?



