I am looking for some alternate way to do:
When I do the W3C validation, I am getting the error:
There's a way you can do this with jQuery if you have included the jQuery file -
Change .classname to that of your iframe or make one if there isn't one. (Take out the attribute from the iframe as well) Put that straight after the iframe closing tag and it adds in the required allowTransparency tag for browsers prior to IE9. As it is within the IE conditional statement, it is not read by the W3C validator. It also eliminates cross browser compatibility and content hiding issues with adding all the CSS that people have already mentioned, if you're using the latest jQuery version anyway. The allowTransparency attribute was created with a clearly defined purpose, so there's no point trying to recreate it with CSS when you can just silently insert it. Hope this helps someone!
(This method assumes you already haveiframe {background-color:transparent}
which doesn't work on older IE versions)