| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| Barru. | Transparency How would I make a table have a semi-transparent background, but one of the cells have a fully opaque background? I know you can do it in ie: Code: <table height="200" width="200" bgcolor="#FF0000" style="filter: alpha (opacity=50);">
<tr>
<td style="position: relative;">Woo! Opaque!</td>
</tr>
<tr>
<td>Woo! 50% Opaque!</td>
</tr>
</table>
__________________ |
| |
| | #2 (permalink) |
| NamePros Member | Warning: Very cheap and nasty, but all I could come up with at the moment ![]() Code: <table height="200" width="200" border="1" style="filter: alpha (opacity=50);">
<tr>
<td bgcolor="#FF0000" style="position: relative;">Woo! Opaque!</td>
</tr>
<tr>
<td bgcolor="#FF0000" style="-moz-opacity:.40;">Woo! 50% Opaque!</td>
</tr>
</table>
There must be a neater way, just haven't found it yet! Andy
__________________ Coming soon - POCHost.com |
| |
| | #3 (permalink) |
| Barru. | FOUND THE CODE Code: <style>
/*Transparency*/
#one {
position: relative;
}
#two {
z-index: 5;
position: relative;
}
#thr {
background-color: #FFFFFF;
border: 1px solid black;
opacity: 0.5;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
</style>
<div id="one">
<div id="thr"></div>
<div id="two">
Content Goes Here
</div></div>
The CSS method dosnt work in IE, so i'm going to have to mess around with it until it does...
__________________ |
| |
| | #4 (permalink) | |
| Senior Member | i did a code "years" ago which may help it is here http://pbsupport2.proboards29.com/in...ead=1094952802 it appears that board is closed to non members(i havnt been there for ages) EDIT: oh well i tried to paste the code here but the forum wouldnt allow me Quote:
Last edited by ethix; 10-23-2006 at 06:52 AM. | |
| |
| | #5 (permalink) |
| Barru. | Woo! I got it working! Here is the IE, Firefox and Opera version: Code: <style>
/*Transparency*/
#one {
position: relative;
}
#two {
z-index: 5;
position: relative;
}
#thr {
background-color: #FFFFFF;
border: 1px solid black;
opacity: 0.5;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
</style>
<comment><div id="one">
<div id="thr"></div>
<div id="two"></comment>
<!--[if IE]><table width="100%" cellspacing="0" cellpadding="10" border="0" align="center" style="filter: alpha (opacity=50);background-color:#FFFFFF;"><![endif]-->
<comment><table width="100%" cellspacing="0" cellpadding="10" border="0" align="center" style="background-color:#FFFFFF;"></comment>
<tr>
<td><!--[if IE]><div style="position:relative;"><![endif]-->
Content Goes Here
</td></tr></table>
<comment></div></div></comment>
__________________ |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |