黑马程序员技术交流社区

标题: 做点击验证t码换图片的时候,做鼠标悬停效果做不出 [打印本页]

作者: hhmm665544    时间: 2014-4-19 23:54
标题: 做点击验证t码换图片的时候,做鼠标悬停效果做不出
  1. <!DOCTYPE html>
  2. <html>
  3.   <head>
  4.     <title>register.html</title>
  5.        

  6.     <meta name="content-type" content="text/html; charset=GBK">
  7.    
  8.     <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
  9.         <script type="text/javascript">
  10.                 function changeIma(img)
  11.                 {
  12.                         img.src = img.src + "?" + new Date().getTime();
  13.                 }
  14.         </script>
  15.   </head>
  16.   
  17.   <body>
  18.            <form action="">
  19.                    <table>
  20.                            <tr><th>用户名:</th><td><input type="text" name="username"/></td></tr>
  21.                            <tr><th>密码:</th><td><input type="password" name="password"/></td></tr>
  22.                            <tr><th>验证码:</th><td><input type="text" name="check"/><img src="/day6/ResponseDemo1" onclick="changeIma(this)" alt="换一张" style="cursor:hand" /></td></tr>
  23.                            <tr><td colspan="2"><input type="submit" value="提交"/></td></tr>
  24.                    </table>
  25.            </form>
  26.   </body>
  27. </html>
复制代码
什么原因造成的呢?我样式也没写错啊,为什么就是没有效果呢?鼠标放图片上不会变成手的形状

作者: 。烊了    时间: 2014-4-20 16:18
cursor:hand 不是标准写法,IE支持它,Firefox,Chrome就不太能正常显示。,你换成cursor:pointer;试试,
作者: hhmm665544    时间: 2014-4-20 16:56
。烊了 发表于 2014-4-20 16:18
cursor:hand 不是标准写法,IE支持它,Firefox,Chrome就不太能正常显示。,你换成cursor:pointer;试试, ...

我去试试看,我用的就是谷歌的浏览器




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2