最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

iframe背景透明的设置方法

来源:动视网 责编:小采 时间:2020-11-27 20:27:51
文档

iframe背景透明的设置方法

iframe背景透明的设置方法:IE5.5开始支持浮动框架的内容透明。如果想要为浮动框架定义透明内容,则必须满足下列条件。 1.与 iframe 元素一起使用的 allowTransparency 标签属性必须设置为 true。 2.在 iframe 内容源文档,background-color 或 body 元素的 bgC
推荐度:
导读iframe背景透明的设置方法:IE5.5开始支持浮动框架的内容透明。如果想要为浮动框架定义透明内容,则必须满足下列条件。 1.与 iframe 元素一起使用的 allowTransparency 标签属性必须设置为 true。 2.在 iframe 内容源文档,background-color 或 body 元素的 bgC


IE5.5开始支持浮动框架的内容透明。如果想要为浮动框架定义透明内容,则必须满足下列条件。
1.与 iframe 元素一起使用的 allowTransparency 标签属性必须设置为 true。
2.在 iframe 内容源文档,background-color 或 body 元素的 bgColor 标签属性必须设置为 transparent

<iframe src="./ads_top_tian.html" allowtransparency="true" style="background-color=transparent" title="test" frameborder="0" width="470" height="308" scrolling="no"></iframe>

当然前提是iframe页面中没有设置颜色.
在上面我们主要是看到了style中的一句代码style="background-color=transparent" 通过以下四种IFRAME的写法我想大概你对iframe背景透明效果的实现方法应该会有个清晰的了解:

<IFRAME ID="Frame1" SRC="transparentBody.htm" allowTransparency="true"></IFRAME>
<IFRAME ID="Frame2" SRC="transparentBody.htm" allowTransparency="true" STYLE="background-color: green"> </IFRAME>
<IFRAME ID="Frame3" SRC="transparentBody.htm"></IFRAME>
<IFRAME ID="Frame4" SRC="transparentBody.htm" STYLE="background-color: green"> </IFRAME>

现在我们来看一个实例
本例主要是iframe对象的allowTransparency属性应用,在该属性设置为true并且iframe所载加页的背景颜色设置为transparent(透明)时iframe将透明化。
allowTransparency设置或获取对象是否可为透明。
bgColor 设置或获取对象的背景颜色

父页面

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>父页面</title>
</head>
<body bgcolor="#FF0000">
<iframe src="index.htm" allowTransparency="true"></iframe>
</body>
</html>

子页面

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>子页面</title>
<style type="text/css">
body
{
 background-color: transparent; 
}
</style>
</head>
<body>
</body>
</html>

更多iframe背景透明的设置方法相关文章请关注PHP中文网!

文档

iframe背景透明的设置方法

iframe背景透明的设置方法:IE5.5开始支持浮动框架的内容透明。如果想要为浮动框架定义透明内容,则必须满足下列条件。 1.与 iframe 元素一起使用的 allowTransparency 标签属性必须设置为 true。 2.在 iframe 内容源文档,background-color 或 body 元素的 bgC
推荐度:
标签: 设置 背景 透明
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top