HTML allowtransparency Attribute

The obsolete allowtransparency attribute was historically used with the <iframe> element to allow the background behind an inline frame to show through when the framed document had a transparent background.

Historical Syntax

The allowtransparency attribute was added to an <iframe> element and commonly assigned the value true:

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

The framed document also needed a transparent background for content behind the iframe to be visible.

Historical Elements

The allowtransparency attribute was historically associated with the <iframe> element.

Element Historical Purpose
<iframe> Allowed a transparent iframe background so content behind the inline frame could be visible.

Historical Use

The allowtransparency attribute was introduced as a proprietary browser feature for inline frames. It was used when a webpage author wanted the document containing an iframe to remain visible through transparent areas of the framed document.

It did not make the iframe content itself transparent. The document loaded inside the iframe still needed to use a transparent background.

Why It Became Obsolete

The allowtransparency attribute was never a standard HTML feature. Modern browsers do not require this attribute for an iframe document to use a transparent background.

Background presentation belongs in CSS, so the background of the document displayed inside the iframe should be controlled by that document's stylesheet.

Modern Alternative

Use CSS in the document loaded inside the <iframe> to create a transparent background. The obsolete allowtransparency attribute is not needed.

Historical HTML

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

Modern HTML

<iframe src="example.html" title="Example"></iframe>

In the document loaded by the iframe, CSS can be used to make the page background transparent:

html,
body {
  background-color: transparent;
}

The following example uses a transparent iframe document so the background of the parent page remains visible behind the iframe content.

Play in Editor

Learn More About CSS Backgrounds

The CSS tutorials provide more information about controlling backgrounds and colors with CSS:

Legacy Browser Support

The allowtransparency attribute was originally associated with older versions of Internet Explorer and was also recognized by some other browsers for compatibility with existing webpages.

Because allowtransparency was a proprietary feature rather than a standard HTML attribute, browser behavior was not defined by the HTML standard. Modern webpages should omit the attribute and use CSS when a transparent iframe document is required.

For additional information about historical browser compatibility, visit Can I Use? . Search for the HTML element or attribute you want to check. Search results can include related HTML features, element attributes, APIs, and other technologies, so select the result that most closely matches the legacy feature you are researching.

Other obsolete attributes historically associated with frames and embedded content include:

  • frameborder - Historically used to control the border around a frame.
  • marginheight - Historically used to control vertical margins inside a frame.
  • marginwidth - Historically used to control horizontal margins inside a frame.
  • scrolling - Historically used to control scrollbars on frames and inline frames.

Specifications

The allowtransparency attribute was a proprietary browser feature and was not standardized as part of HTML. Modern iframe behavior is defined by the WHATWG HTML Living Standard .