关于css问题,紧急求救!!!!!在线等待!!!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<style type=text/css>
<!--
body { margin: 5; }
.tm { background: #4665B5; }
-->
</style>
<body>
<table width="100%" border="1">
<tr class=tm>
<td><a href="http://www.sohu.com">sohu.com</a></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
帮我看看上面这个代码
我用class=tm来处理
但是,如何使当鼠标移动到<tr class=tm>行的时候,鼠标就变成小手形,并且可以是<tr>这一行能够变为其他的颜色?
多谢!
问题点数:20、回复次数:6Top
1 楼yongtang(Reloaded)回复于 2002-07-29 17:05:38 得分 4
在tm这个类里加入cursor: hand就能使其在鼠标移动到项目上时显示为手型,变为其它颜色就需要建立其他几个css的类,这样在你这个tr里就加入事件,比如onMouseOver时运行一个类,当onMouseOut恢复为原始的类。Top
2 楼thinkover(JavaCoffee)回复于 2002-07-29 17:06:57 得分 4
你试试下面的代码,不合适的可以修改:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type=text/css>
<!--
body { margin: 5; }
/* cursor: crosshair; (wait | move | crosshair | hand | help | sw-resize | nw-resize | se-resize | ne-resize | n-resize | s-resize | w-resize | e-resize ) 控制光标 */
.tm { background: #e7e7e7; cursor:crosshair ;color:green}
a:link {text-decoration : none}
A:Visited {color: #000000;text-decoration : none}
A:Active {color: #ff0000;text-decoration : none}
A:Hover {text-decoration : none;color: #ee0000}
-->
</style>
</head>
<body>
<table width="100%" border="1">
<tr class=tm font="green">
<td><a href="http://www.sohu.com">sohu.com</a></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>Top
3 楼meizz(梅花雪)回复于 2002-07-29 17:18:39 得分 4
在CSS里有一个优先级别的问题,哪一个CSS最接近你的目标,那个CSS的优先级别就越高。
在网页里所有的链接默认鼠标的形式是手形,你若没对它进行重新定义,而sohu.com这几个文字最接近的CSS定义就是<a>,所以它一定会是手形。
举个例子:
<style>
.1 {cursor: default}
</style>
<a href="http://www.sohu.com"><span class=1>sohu.com</span></a>
这时候这个链接就不再是手了。因为sohu.com最近的CSS定义是<span class=1>
同样一个例子,交换一下位置,结果就会不一样:
<span class=1><a href="http://www.sohu.com">sohu.com</a></span>
这样写的链接由于<a>最近,所以鼠标的形式还是手
Top
4 楼jzsh2000(瘦猫)回复于 2002-07-29 17:34:37 得分 8
试试这个:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<style type=text/css>
<!--
body { margin: 5; }
.tm { background: #4665B5; cursor: hand }
-->
</style>
<body>
<table width="100%" border="1">
<tr class=tm onmouseover="this.style.backgroundColor='#ff0000'" onmouseout="this.style.backgroundColor=''">
<td><a href="http://www.sohu.com">sohu.com</a></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>Top
5 楼contlink(conlink)回复于 2002-07-29 17:42:31 得分 0
但是我在onmouseover事件的时候,还处理显示菜单
如果同时进行操作,就不知道应该怎么处理了
Top
6 楼contlink(conlink)回复于 2002-07-29 17:47:27 得分 0
好了,原来onmouseover事件中可以同时处理多个事件呀
多谢了Top




