Web design question (iframes, css)

I have an iframe that I’ve made transparent:

<IFRAME
src=“bla.html”
width=350
height=250
style=“filter:alpha(opacity=80);”>
</IFRAME>
This works great, except the entire content of bla.html comes out transparent. I want the iframe control itself to be transparent, but I want the content (ie, the text and images within bla.html) to come across solid. Any ideas how I could accomplish this?

This webpage demonstrates the effect. Look at the grey floating frame on the right. Its transparent but the text is not.

I’ve looked at the guy’s source, but there are so many other effects going on that I can’t parse it.

The area on the right, the one that contains “hiking tips”, “about me”, “local trails” etc, is not an iframe.

If you resize the text so it’s too large for the container, it will break the bounds, rather than disappearing or adding scrollbars.

The one on the right is simply a DIV called “menu_block”. I guess you could use that effect, and have “overflow: scroll” in your style declaration.

What he seems to have done though, is to create a separate DIV element that is the exact height required to fill the menu (the size of the outside div, minus the border-widths, and the height of the top controls), and given that a background, and an opacity of 80%. The three different variations on filters there are all doing the same thing, just for different browser levels.


filter: alpha(opacity=80);  

is simply the way it SHOULD be done, the


filter: progid:DXImageTransform.Microsoft.Alpha(opacity=80);   

and


-moz-opacity: 0.80; 

are browser extensions that are added by MS and Mozilla in order to get them to work.

Because he declared that DIV element before the text, it will be rendered beneath it. If he declared it after the rest of the contents, the background would be on top, and the text would be seen through it.

If you notice also, the iframe on the left that has the scroll controls on it, the controls are also 80% transparent in IE. Mozilla and other browsers ignore styles that try to act on the scrollbars, reasoning (for good or ill) that they are part of the window, not the web page itself, and should therefore be outside the realm of CSS.

I forgot to finish.

I am not sure that it’s possible to do what you want. You will not be able to get transparent controls under anything but IE.

You could try playing around with the scrollbar attributes in IE, but AFAIK they are all related to simply coloring them. Maybe making it part of the color scheme will be enough to get by with?

I would love to be corrected though. I can think of a few places an effect like this would look very nice.

Not sure I quite follow your last post. Using the code I have does in fact render the entire iframe partially transparent - that includes the scrollbar portion. This is fine - I want the control transparent. What I don’t want is the text/images used as the source html for the iframe; however the background should still be transparent.

It very well may not be possible. I don’t really understand css inhereitance…is it possible to have to a sublevel CSS definition that doesn’t inherit the filter style?

Here’s a link to my experimental page:

Transparent Iframes

Don’t worry about what everything else looks like…just notice the iframe I have in the center.

Also, its likely none of this will work in non-IE browsers. I haven’t bothered with compatibility yet.

I’ve done this before. Learned it on–get this–teen-made webdesign tutorials. :slight_smile:

JennysPage.net - Transparent iFrames
Just look at the last two textboxes for the code. The top two lead to a lightening of your text, which you indicated you didn’t want. Note: I think there’s a typo in that last textbox… I don’t think the “none” should be there, it should only be "transparent, IIRC.

JennysPage.net - Transparent scrollbars
Pretty cool effect.