How To Fix – There Is No Attribute “allowTransparency”

By on May 4, 2013

If you are getting a message ‘There is no attribute allowTransparency‘ while validating your site with W3C Validator then this post is for you.

If you are using document type XHTML Transitional then maybe i can solve your problem. The attribute allowTransparency belongs to iframe. So we will be taking up a short code containing iframe tags with the attribute allowTransparency in it.

The best example would be Facebook Like Box, because most blogs and websites use it and it fails to validate with W3C Validator.

The code for Facebook like box with Page Username Codefap is given below -

But this code fails to validate for the only reason that it contains allowTransparency attribute. And this can be simply fixed by replacing the code given above with the following code -

We have written two codes for the Facebook Like Box – One with allowTransparency with if statement for IE and other one without it. And this solves the problem. By using this embed code with conditional HTML elements, you can validate your site properly even after using allowTransparency attribute on the web page.

About Omkar Bhagat

Omkar is the owner of Codefap.com. He writes blogs, makes video tutorials and love to learn new things about computers and programming.
Subscribe To Blog Feed