分享你我的心得.
共乘一片美好网络.

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>
赞(0)
未经允许不得转载:小叶白龙博客 » iframe背景透明的设置方法
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址