一个变色表格,请帮忙修改一下,使鼠标移动到表格选项时该表格中的文字颜色不变。
下面是一个变色的源代码,我在使用时发现鼠标移动到表格选项的非文字处时文字为原色状态,移动至文字处则文字变为黑色,有没有办法使文字不变为黑色?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>最新更新</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<STYLE>BODY {
FONT-SIZE: 9pt
}
FONT {
FONT-SIZE: 9pt
}
CENTER {
FONT-SIZE: 9pt
}
TABLE {
FONT-SIZE: 9pt
}
A {
COLOR: #ffffff; FONT-SIZE: 9pt; TEXT-DECORATION: none
}
A:hover {
COLOR: black; TEXT-DECORATION: none
}
A:hover {
COLOR: black; TEXT-DECORATION: none
}
A.bg:hover {
BACKGROUND-COLOR: #336699
}
</STYLE>
<META content="Microsoft FrontPage 4.0" name=GENERATOR>
<base target="_blank">
</HEAD>
<BODY leftMargin=0 scroll=auto text=#000000
topMargin=0 vlink="#0000FF" alink="#800000">
<table border="0" width="180" bgcolor="#008000" cellspacing="0" style="position: relative; left: 5" cellpadding="0">
<tr>
<td width="100%">
<p align="center"><font color="#FFFFFF">主菜单</font></td>
</tr>
</table>
<table border="1" width="180" cellspacing="0" bgcolor="#000000" border="1" cellspacing="0" style="position: relative; left: 5; color: #0000FF" onMouseover="changeto('#C0C0C0')" onMouseout="changeback('')" changto("#66CCFF") changeback("#66CCFF") cellpadding="0">
<tr>
<td width="180" align="center" style="color: #FFFFFF"><a href="1.htm">项目1</a></td>
</tr>
<tr>
<td width="180" align="center" style="color: #FFFFFF"><a href="2.htm">项目2</a></td>
</tr>
<tr>
<td width="180" align="center" style="color: #FFFFFF"><a href="3.htm">项目3</a></td>
</tr>
<tr>
<td width="180" align="center" style="color: #FFFFFF"><a href="4.htm">项目4</a></td>
</tr>
</table>
</BODY></HTML><script language="JavaScript1.2">
function changeto(highlightcolor){
source=event.srcElement
if (source.tagName=="TR"||source.tagName=="TABLE")
return
while(source.tagName!="TD")
source=source.parentElement
if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
source.style.backgroundColor=highlightcolor
}
function changeback(originalcolor){
if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")
return
if (event.toElement!=source)
source.style.backgroundColor=originalcolor
}
</script>
问题点数:100、回复次数:2Top
1 楼net_lover(【孟子E章】)回复于 2003-02-04 22:44:50 得分 100
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>最新更新</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<STYLE>BODY {
FONT-SIZE: 9pt
}
FONT {
FONT-SIZE: 9pt
}
CENTER {
FONT-SIZE: 9pt
}
TABLE {
FONT-SIZE: 9pt
}
A {
COLOR: #ffffff; FONT-SIZE: 9pt; TEXT-DECORATION: none
}
A:hover {
TEXT-DECORATION: none
}
A.bg:hover {
BACKGROUND-COLOR: #336699
}
</STYLE>
<META content="Microsoft FrontPage 4.0" name=GENERATOR>
<base target="_blank">
</HEAD>
<BODY leftMargin=0 scroll=auto text=#000000
topMargin=0 vlink="#0000FF" alink="#800000">
<table border="0" width="180" bgcolor="#008000" cellspacing="0" style="position: relative; left: 5" cellpadding="0">
<tr>
<td width="100%">
<p align="center"><font color="#FFFFFF">主菜单</font></td>
</tr>
</table>
<table border="1" width="180" cellspacing="0" bgcolor="#000000" border="1" cellspacing="0" style="position: relative; left: 5; color: #0000FF" onMouseover="changeto('#C0C0C0')" onMouseout="changeback('')" changto("#66CCFF") changeback("#66CCFF") cellpadding="0">
<tr>
<td width="180" align="center" style="color: #FFFFFF"><a href="1.htm">项目1</a></td>
</tr>
<tr>
<td width="180" align="center" style="color: #FFFFFF"><a href="2.htm">项目2</a></td>
</tr>
<tr>
<td width="180" align="center" style="color: #FFFFFF"><a href="3.htm">项目3</a></td>
</tr>
<tr>
<td width="180" align="center" style="color: #FFFFFF"><a href="4.htm">项目4</a></td>
</tr>
</table>
</BODY></HTML><script language="JavaScript1.2">
function changeto(highlightcolor){
source=event.srcElement
if (source.tagName=="TR"||source.tagName=="TABLE")
return
while(source.tagName!="TD")
source=source.parentElement
if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
source.style.backgroundColor=highlightcolor
}
function changeback(originalcolor){
if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")
return
if (event.toElement!=source)
source.style.backgroundColor=originalcolor
}
</script>
Top
2 楼hqx0522(流水之风)回复于 2003-02-06 21:12:17 得分 0
谢谢您回复这个问题,我自己也发现将
A:hover {
COLOR: black; TEXT-DECORATION: none
}
A:hover {
COLOR: black; TEXT-DECORATION: none
}
删除就行了,不过问题既然提出来了,就给分吧Top




