---
title: "iframe透明"
author: "lbsnd"
date: "2012-01-05T16:43:36Z"
tags: []
categories: ["Web前端"]
slug: "iframe"
draft: false
lastmod: "2012-01-05T16:45:08Z"
id: 1336126
url: "https://lbsnd.iteye.com/blog/1336126"
---

iframe背景不透明实在是不方便，实现其背景透明，但是里面的文字，内容啥的不透明，方法如下：

 

1、在主页面iframe中添加如下代码

 

&lt;iframe width="900" height="50" scrolling="no" frameborder="0" allowtransparency="true" src="tit.html"&gt;&lt;/iframe&gt;

 

2、在被嵌套的页面的body添加如下：

 

&lt;body style="background-color:transparent " &gt;