• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2163
  • Last Modified:

allowtransparency="true" in an iFrame with xhtml transitional doctype


I have an iFrame in a page that needs to have


set to work in IE7. The images displayed in the iFrame are PNGs with transparency and the background is not a solid color. So I really do need this attribute for the page to look correct in IE7.

But I would also like the page to validate with the DOCTYPE:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

Is there a way to keep this attribute for IE7 and have a document that passes validation ?

  • 2
1 Solution
allowtransparency is a proprietary attribute that only works with browsers from IE 5.5 and up, so there is
a reason why it doesn't validate, since it is not common browser standard. I personally don't see a way
to have that iframe attribute and same time achieving validation.

Maybe you try a completely different alternative and work with a server side includes that produces the desired
result, thus abandon any iframe use at all.

There is weak spots in common browser standards and usability and the transparency issue sure
is one of them. Let's hope that browser manufacturers will find an agreeable solution with W3C soon.
howtogetitrightAuthor Commented:
Hi xberry,

I want to keep the iframe as an iframe. Lets hope someone replies with a solution !

howtogetitrightAuthor Commented:
I seem to have got it working using conditional comments. So I'll close this question.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now