用css控制鼠标样式的语法如下:文本或其它页面元素 把 * 换成如下15个效果的一种:下面是对这15种效果的解释。移动鼠标到解释上面,看看你的鼠标起了什么变化吧!hand是手型 pointer也是手型,这里推荐使用这种,因为这可以在多种浏览器下使用。crosshair是十字型 text是移动到文本上的那种效果 wait是等待...
<a href="#" id="a_03" style="cursor:pointer;"> 测试</a>这么写,超链接在鼠标划过的时候就变成了手型。
点击某一行的超链接,table表格变色,源码如下,请点击第一行。
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AAAAAAAAAAAA.aspx.cs" Inherits="AAAAAAAAAAAA" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>111111111</title>
</head>
<body>
<table id="table1" border="1px;">
<tr >
<td onclick="javascript:this.parentNode.style.backgroundColor='red';"><a href="#" id="a1" style="cursor:pointer;"> 测试1</a></td>
<td onclick="javascript:this.parentNode.style.backgroundColor='red';"><a href="#" id="a2" style="cursor:pointer;"> 测试2</a></td>
<td onclick="javascript:this.parentNode.style.backgroundColor='red';"><a href="#" id="a3" style="cursor:pointer;"> 测试3</a></td>
<td onclick="javascript:this.parentNode.style.backgroundColor='red';"><a href="#" id="a4" style="cursor:pointer;"> 测试4</a></td>
</tr>
<tr>
<td colspan="4" align="center"><a href="#" id="a5" style="cursor:pointer;"> 测试4</a></td>
</tr>
<tr>
<td colspan="4" align="center"><a href="#" id="a8" style="cursor:pointer;"> 测试7</a></td>
</tr>
</table>
</body>
</html>
我这个测试代码将第一行所有单元格的内容,全部设为了超链接。楼主注意了,如果楼主想点击某一个单元格实现变色,那么代码如下
<td ><a href="#" id="a2" style="cursor:pointer;" onclick="javascript:this.parentNode.parentNode.style.backgroundColor='red';"> 测试2</a></td>
改成这样,则只有点击“测试2”这个超练级的时候,某一行变色。写完了才发现,与楼主的要求不对。所以临时修改了一下。
手写,绝对的手写。2011-07-29
js写法:onmouseover='this.style.cursor=hand',什么叫高亮,具体点,有很多种做法哦,是单一的字体变大,颜色改变了,还是多个层出来,层上显示点击后的内容,区别就是多个层出来后不影响其他部分2011-07-28