<iframe src="" allowtransparency="true">

Browser
  • IE
Type

The allowtransparency attribute of the IFRAME element specifies whether to allow a transparent background in the iframe.


<iframe src="example.html" allowtransparency="true"></iframe>

Attribute Value Explanation
allowtransparency=" " true allows the transparency
false not allows the transparency (default)

Extension attribute. (Non standard attribute)

If you specify the "true" value for this attribute, add the following CSS for the BODY tag of the page to load into the iframe.

<body style="background-color: transparent;">

Example

The page that sets the iframe


<div style="padding: 10px; background: #ffffff url(image/back2.gif);">

<p><iframe src="iexample_l.html" width="300" height="150" allowtransparency="true">Alternate content</iframe></p>

</div>

The page to load into the iframe (iexample_l.html)


<html>
<head>
<title>TAG index</title>
</head>
<body style="background-color: transparent;">

<p>transparent example ...</p>

</body>
</html>

Output