HOBALL 筆記簿

February 13, 2009

iframe transparency

Filed under: HTML+CSS — Tags: , , , — hoball @ 4:32 pm

Both Firefox and Chrome display iframe with background transparency, but not in IE.
Here is the trick to make the iframe background to be transparency:

HTML Block:

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

To play safe, we can also add style="background:transparent;" for firefox/chrome
So the overall iframe tag will be     <iframe src=”fram1.html” style=”background:transparent;” allowtransparency=”true”></iframe>

CSS Block of fram1.htm:


body {

background: transparent;

}

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: