View Full Version : Transparent Background


tee36
07-29-2004, 08:11 PM
How would I make a transparent background?

pb&j
07-29-2004, 08:17 PM
the background of the body, a div, or a table are already transparent by default unless you have specified a background color or image in it.

perhaps explain further on what you are trying to do?

tee36
07-29-2004, 08:47 PM
In my website I'm using index.html to put all my navgation, layout and stuff, I link my index.html to all my content pages, so all of my content has the index frame around it. What I want is to have the content pages background to be transparent.

This is the current code I'm using. The allow transparency dosn't seem to be doing anything.

<iframe src="main.html" name="main" frameborder="0" framespacing="0" width="320" height="310" allowtransparency="true">&nbsp;</iframe></td>

Do I Make Sense?

tee36
07-29-2004, 09:11 PM
Do I Make Sense?

kittycat
07-29-2004, 10:04 PM
Did you make the background of the page inside the iframe transparent? If not add this to the body tag of the page...
style="background-color: transparent"

fahad
07-29-2004, 10:16 PM
Yup you have to change the CSS to not only in the iframe code.. do "style="background-color: transparent" as kittycat said :P

tee36
07-30-2004, 03:31 AM
It isn't working :rolleyes:

Luzee12
07-30-2004, 08:34 AM
I don't really understand what you're trying to do. Could you maybe show us your page, or some more of your coding?

aiee
08-27-2004, 09:15 PM
Sorry if this should be posted elsewhere, this thread comes up high in google searches so I thought I'd post here about it.
---

I had a ^^^^ of a time finding a good answer to this problem, and sort of lucked into a solution. I want to make an iframe transparent in IE and NS (versions 5 and 6 respectively). If you do allowtransparency="true" in an iframe, it works in netscape, but fails in IE. If you give the framed page a background color, then use IE's chroma:filter tag... it works in IE, but fails in netscape.

The solution is this:

1. First Give your Iframe the allowtransparency="true" tag.
2. Make sure the source page's content has NO background color specified... not in the page itself, and not in any stylesheet linked to the page! This will make the body color pure white.
3. Add this to your iframe tag:
style=filter: chroma(color="#FFFFFF");

Step 1 and 2 makes the iframe transparent in netscape/mozilla/firefox. As long as the page has no other background specified, the transparency works... but if you specify any background color, the transparency is lost.

Step 3 makes it work in Internet explorer, IE's filter:chroma nukes the white background. That means you must make sure no other part of your page (or at least nothing in that iframe) has pure white, or it will be made invisible. That's pretty easy, if something is even slightly differently colored (for example #FFFFFD) then it won't be transparent.

So the example code:

<IFRAME src="anything.htm" frameborder="No" style="FILTER: chroma(color=#FFFFFF)" allowtransparency="true">
</IFRAME>

And "anything.htm" must not have any bgcolor specified in its body tag, or in a style section, or in any CSS that it's linked to.

Hope this was helpful to someone.