curtis591
asked on
Mouseover of cell in a grid with a hyperlink
I have the following code. When I move into the orange part of the cell I want the writing to turn white. How do I do this? If I remove the <a> tag it works ok. When I have the <a> tag it only works when I am over the writing.
<html>
<head>
<title>Safety Information</title>
<style>
.overclass {color:white}
.outclass {color:black}
a:hover {color:white}
</style>
</head>
<body topmargin=0>
<table border="0" width="94%" cellspacing="2" cellpadding="0">
<tr>
<td height = 25 width="100%" class="outclass" onMouseover="this.classNam e='overcla ss'" onMouseout="this.className ='outclass '" bgcolor="FF6600">
<a href="mypage.asp" style="text-decoration: none;"><font face="Arial" size=3><b> My Page</b></font></a>
</td>
</tr>
</table>
</body>
</html>
<html>
<head>
<title>Safety Information</title>
<style>
.overclass {color:white}
.outclass {color:black}
a:hover {color:white}
</style>
</head>
<body topmargin=0>
<table border="0" width="94%" cellspacing="2" cellpadding="0">
<tr>
<td height = 25 width="100%" class="outclass" onMouseover="this.classNam
<a href="mypage.asp" style="text-decoration: none;"><font face="Arial" size=3><b> My Page</b></font></a>
</td>
</tr>
</table>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It just needs asmall adjustment in the styles:
<html>
<head>
<title>Safety Information</title>
<style>
.overclass a:hover{color:white}
.outclass {color:black}
a {color:black}
</style>
</head>
<body topmargin=0>
<table border="0" width="94%" cellspacing="2" cellpadding="0">
<tr>
<td height = 25 width="100%" class="outclass" onMouseover="this.classNam e='overcla ss'" onMouseout="this.className ='outclass '" bgcolor="FF6600">
<a href="mypage.asp" style="text-decoration: none;"><font face="Arial" size=3><b> My Page</b></font></a>
</td>
</tr>
</table>
</body>
</html>
However, I would incorporate font bold tags in the CSS. Using old style formatting tags in the same page as CSS makes it difficult to maintain , can confuse the browser if they are in conflict.
Cd&
<html>
<head>
<title>Safety Information</title>
<style>
.overclass a:hover{color:white}
.outclass {color:black}
a {color:black}
</style>
</head>
<body topmargin=0>
<table border="0" width="94%" cellspacing="2" cellpadding="0">
<tr>
<td height = 25 width="100%" class="outclass" onMouseover="this.classNam
<a href="mypage.asp" style="text-decoration: none;"><font face="Arial" size=3><b> My Page</b></font></a>
</td>
</tr>
</table>
</body>
</html>
However, I would incorporate font bold tags in the CSS. Using old style formatting tags in the same page as CSS makes it difficult to maintain , can confuse the browser if they are in conflict.
Cd&
ASKER
Thanks for all you feed back, I did get this working eventually and I like the total css way. Is there a way that to get CSS's working in the wonderful Netscape browser without an enormous amount of code (I'm kidding about the wonderful part). If this can't be done easily please don't bother with showing me all the code because we got rid of Netscape but I'm curious about other possibilities for internet solutions.
Doing it in Netscrap 4.x takes a bunch of really ugly scripting. It does not support hover, or mouse over on a cell. To do the color change you have to have the links in a layer and re-write the layer. Layers have to be absolutely position, and NS calculate the position from window, not the containing element, so in order for it to work inside of a cell it takes additional code to handle positioning and to deal with resolution and screen size problems. Then to top it all off. You also have to re-write the the layers for IE as well because the two mothods cannot co-exist. It is either re-write the layers for all browsers or use separate pages. Be glad you got rid of Netscrap.
Cd&
Cd&
ASKER
Why am I not suprised? I think Netscrap defines that perfectly.
<html>
<head>
<title>Safety Information</title>
<style>
.outclass {color:black;background-co
.overclass {color:white;background-co
</style>
</head>
<body topmargin=0>
<table border="0" width="94%" cellspacing="2" cellpadding="0">
<tr>
<td height = 25 width="100%" class="outclass" onmouseover="this.classNam
My Page 2
</td>
</tr>
</table>
</body>
</html>