allowTransparency

Jump to: navigation, search

allowTransparency



Summary

Sets or retrieves whether the object can be transparent.


Applies to  ?

Examples

View live exampleThe following example shows four ways to use the allowTransparency attribute, with and without the background-color attribute. Because the allowTransparency attribute of Frame1 is set to true, Frame1 renders red, the background color of the parent document. The allowTransparency attribute of Frame2 is also set to true, however the background-color attribute of Frame2 is set to green, so Frame2 renders green. Because the allowTransparency attribute of Frame3 is set to false (the default value), Frame3 renders white, the color of the t:SRC document. The allowTransparency attribute of Frame4 is also set to false, so Frame4 renders white even though the background-color attribute of Frame4 is set to green.

<BODY STYLE="background-color: red">
<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>				
</BODY>

Notes

Remarks

When the property is set to VARIANT_FALSE, the backgroundColor property of the object can only be that of the window. When the property is set to VARIANT_TRUE, the backgroundColor property of the object can be set to any value, including the default value of transparent.

Syntax

Standards information

There are no standards that apply here. Support for this attribute has been dropped in IE9.

Compatibility

Desktop

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic Support Beta
1
5
3
0.8

Mobile

Feature Android BlackBerry Chrome for mobile Firefox Mobile (Gecko) IE Mobile Opera Mobile Opera Mini Safari Mobile
Basic Support 1
6
Beta
14
4
3
Beta
3

See also

Related pages (MSDN)

  • frame
  • iframe

Attribution

This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]