Click to See Complete Forum and Search --> : semi-transparent colour on a table?


hammerslane
10-06-2003, 04:08 AM
-RESOLVED-
I have a background image on my table, and I have a few <TD>'s scattered about the table. I want to colour a few of the <td>'s in a colour... but I also want the background image to show through partially. So I was basically wondering if it's possible to tell a browser to have a semi-transparent bgcolor on a <td>? do i need the 'style' tag?
thanks people :cool:

pyro
10-06-2003, 07:05 AM
In IE, you could use the alpha filter (http://msdn.microsoft.com/workshop/samples/author/dhtml/DXTidemo/DXTidemo.htm), though it won't work in other browsers and is not a part of the CSS1 or CSS2 specs...

hammerslane
10-06-2003, 07:22 AM
ah right... one thing that might be quite key (that i forgot to mention) is that the page i want the transparency to occur on is actually on an intranet over a windows server network... do you think that code would work if i put it onto the server and different computers tried to view it?

thanks pyro

pyro
10-06-2003, 07:24 AM
It should work as long as they are browsing with IE 5.5+

hammerslane
10-06-2003, 07:34 AM
thanks pyro, you're the don.
i'm having a slight problem with that microsoft website you gave me... is it possible to exclude the text (that is within the td) from the filter span?

pyro
10-06-2003, 08:09 AM
I believe the filter applies to the element and all it's children, so the text will also be transparent. Here's an example:

<div style="filter: alpha(style=0,opacity=25); width: 300px; height: 150px; color: #990000; background-color:#99ccff">
<span>Some semi-transparent text/background.</span>
</div>

hammerslane
10-06-2003, 08:12 AM
ah i see... it's a bit annoying if the text is transparent. anyone know of a way that i might exclude the text from the div tag? i tried just swapping about the tags here and there to no prevail... :confused:
thanks again pyro :cool:

Sam
10-06-2003, 06:32 PM
I believe if you put the text in a div/span of its own within the td, and define the opacity from there, you should be able to get the result you want (ie, set the td's opacity to 40 and the text's opacity to 100, this might not be true though

pyro
10-06-2003, 07:21 PM
No, I tried that before I posted, which is what led me to say "I believe the filter applies to the element and all it's children, so the text will also be transparent."

Fang
10-07-2003, 01:35 AM
This will fix it:
<span style="position:relative;">Semi-transparent background normal text.</span>

hammerslane
10-07-2003, 02:49 AM
thanks pyro, you rock
edit: thanks fang... and pyro! :rolleyes:

[RESOLVED]

pyro
10-07-2003, 07:09 AM
Umm... that was Fang... ;)

niknewguy
03-13-2006, 08:30 PM
ummm i also need help
:confused:
wer would i put this "<div> . . . . </div>" tag in?
do i have to put this tag inside the "<table></table>" tag?
or <td></td>? or <tr></tr>? or somwhere out this tags?
:confused: plz help me