webdott
asked on
change background onmouseover to white from transparent on link
i want to create a link bar like the one on this website:
http://martinstar.com/
when you mouesover the link [ which is transparent to the background ]
the background of that link is white with no transparency.
I do not want the text to change change in transparency which is what i have in the code
that i have come up with.
thanks
http://martinstar.com/
when you mouesover the link [ which is transparent to the background ]
the background of that link is white with no transparency.
I do not want the text to change change in transparency which is what i have in the code
that i have come up with.
thanks
<HTML>
<HEAD>
<TITLE>Untitled</TITLE>
<STYLE>
div.transON {width: 100%; background-color: #ffffff;opacity:.50;filter: alpha(opacity=50); -moz-opacity: 0.5; }
div.transOFF {width: 100%; background-color: #ffffff;}
</STYLE>
</HEAD>
<BODY>
<TD BACKGROUND="images/hdr_bg2.png" WIDTH="20%" VALIGN=TOP ONMOUSEOVER="this.className='transON">
<DIV class="transOFF" onmouseover="this.className='transON'" onmouseout="this.className='transOFF'">
<P></P>
<P ALIGN=CENTER>
<B><FONT COLOR="BLACK">test2</FONT></B></TD>
</BODY>
</HTML>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Coolersport,
this works great except the TEXT in the cell is also transparent making it it hard to see.
Any way of making the text not transparent or opac?
thanks
this works great except the TEXT in the cell is also transparent making it it hard to see.
Any way of making the text not transparent or opac?
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
the last one is not working at all?
am i supposed to add the td code from before?
<STYLE>
td.over {opacity:1;filter: alpha(opacity=100); -moz-opacity: 1;}
td {background-color: #ffffff;opacity:.50;filter : alpha(opacity=50); -moz-opacity: 0.5; }
</STYLE>
am i supposed to add the td code from before?
<STYLE>
td.over {opacity:1;filter: alpha(opacity=100); -moz-opacity: 1;}
td {background-color: #ffffff;opacity:.50;filter
</STYLE>
ASKER
i came up with this:
it works how i want it with the exception of the cell background that is #e10000
will not turn solid white #ffffff when moused over? it is still semi-transparent
it works how i want it with the exception of the cell background that is #e10000
will not turn solid white #ffffff when moused over? it is still semi-transparent
<HTML>
<HEAD>
<TITLE>Untitled</TITLE>
<STYLE TYPE="text/css"><!--
.trans { background-color : #E10000;
filter: ty=10);
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100);}
.text { font-family : "sans-serif";
font-size : 14.0px;
text-align : center;
position: relative;}
.img1 { filter: ty=8);
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=50);}
-->
</STYLE>
<STYLE>
td.over {opacity:1;filter: alpha(opacity=100); -moz-opacity: 1;}
td {background-color: #ffffff;opacity:.10;filter: alpha(opacity=10); -moz-opacity: 0.1; }
</STYLE>
</HEAD>
<BODY>
<P>
<TABLE BACKGROUND="images/img1.png" WIDTH="600" CELLPADDING="2" CELLSPACING="0" BORDER="0">
<TR>
<TD WIDTH="33%" VALIGN=TOP>
<CENTER>
<P ALIGN=CENTER>
<TABLE WIDTH="300" CELLPADDING="0" CELLSPACING="0" BORDER="0" CLASS="trans">
<TR>
<TD WIDTH="100%" VALIGN=TOP ONMOUSEOVER="this.className = 'over'" ONMOUSEOUT="this.className = ''">
<P CLASS="text" ALIGN=CENTER>
<B><FONT SIZE="5">hello</FONT></B></TD>
</TR>
</TABLE></P>
</CENTER>
</TR>
</TABLE>
</BODY>
</HTML>
I have uploaded the same code above at http://coolersport.info/test.html. You can test it out. No, you do not need the old css (td.over and td) anymore.
BTW, it is tested in Firefox, IE6 & 7, Safari. Works as you desired :D
ASKER
thanks
Open in new window