CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
山寨机中的战斗机! 程序优化工程师到底对IT界有没有贡献
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Web 开发 >  其他

关于css问题,紧急求救!!!!!在线等待!!!

楼主contlink(conlink)2002-07-29 16:18:36 在 Web 开发 / 其他 提问

<!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>&nbsp;</td>  
      </tr>  
      <tr>  
          <td>&nbsp;</td>  
          <td>&nbsp;</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>&nbsp;</td>  
      </tr>  
      <tr>  
          <td>&nbsp;</td>  
          <td>&nbsp;</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

相关问题

  • 紧急,在线等待
  • css的问题(在线等待)
  • 紧急求助于, 在线等待, NNNNNNNNNNNNNNNNNNNNNNNNNN
  • 紧急求助(在线等待)!
  • 紧急求助!(在 线等待)
  • 紧急求救!!!(在线等待~~)
  • 紧急求助,在线等待!!!!!!!
  • 紧急求助!在线等待!
  • 紧急求救 在线等待
  • 紧急求助!在线等待

关键词

得分解答快速导航

  • 帖主:contlink
  • yongtang
  • thinkover
  • meizz
  • jzsh2000

相关链接

  • Web开发类图书

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo