[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 10-23-2006, 06:08 AM   #1 (permalink)
Barru.
 
Barrucadu's Avatar
 
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,731
78.50 NP$ (Donate)

Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold


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>
How would I change that code to work in other browsers?
Barrucadu is offline  
Old 10-23-2006, 06:30 AM   #2 (permalink)
NamePros Member
 
Join Date: Sep 2006
Posts: 132
0.00 NP$ (Donate)

andysyme will become famous soon enoughandysyme will become famous soon enough


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>
I have left your IE handling as is. I use the -moz-opacity for firefox. However, I had to style each cell individually. Have a play and you'll get the idea!

There must be a neater way, just haven't found it yet!

Andy
__________________
Coming soon - POCHost.com
andysyme is offline  
Old 10-23-2006, 06:36 AM   #3 (permalink)
Barru.
 
Barrucadu's Avatar
 
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,731
78.50 NP$ (Donate)

Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold


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>
Demo: http://www.white-knights-templar.com/phpBB2/index.php

The CSS method dosnt work in IE, so i'm going to have to mess around with it until it does...
Barrucadu is offline  
Old 10-23-2006, 06:49 AM   #4 (permalink)
Senior Member
 
ethix's Avatar
 
Join Date: Aug 2006
Location: Australia
Posts: 1,173
159.95 NP$ (Donate)

ethix is a splendid one to beholdethix is a splendid one to beholdethix is a splendid one to beholdethix is a splendid one to beholdethix is a splendid one to beholdethix is a splendid one to beholdethix is a splendid one to beholdethix is a splendid one to behold


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:
1. You have included too many images in your signature or in your previous post. Please go back and correct the problem and then continue again.

Images include use of smilies, the vB code [img] tag and HTML <img> tags. The use of these is all subject to them being enabled by the administrator.

Last edited by ethix; 10-23-2006 at 06:52 AM.
ethix is offline  
Old 10-23-2006, 06:52 AM   #5 (permalink)
Barru.
 
Barrucadu's Avatar
 
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,731
78.50 NP$ (Donate)

Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold


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>
Barrucadu is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 04:48 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85