在悬停鼠标关闭按钮手不出现

时间:2014-02-07 08:36:55

标签: javascript html

我已经为关闭按钮编写了一段javascript,但是当我将鼠标悬停在关闭按钮上时鼠标图标没有变为手,所以我无法关闭它,但是在关闭按钮的某些点出现了手 我在firefox和chrome上遇到了这个问题 IE工作正常

以下是其中的一部分

href="javascript:closeWin()"   
keephref="javascript:closeWin()"   
style="cursor: default;

下面是它的css

element.style {
  cursor: default;
}

6 个答案:

答案 0 :(得分:2)

默认为普通箭头。指针就是手。

style="cursor: pointer;


element.style {
   cursor: pointer;
}

答案 1 :(得分:2)

添加显示指向手形光标的CSS cursor:pointer;

如果您使用的是<a>标记,则不要向其添加cursor:default;,因为<a>标记已经显示指向光标。

答案 2 :(得分:0)

如果标签是链接,则删除样式,因为href将提供手

<a href="#" onclick="closeWin(); return false">Close</a>

我不知道你需要什么keephref,但不建议使用javascript:protocol作为链接

答案 3 :(得分:0)

如果您想显示手形光标,请使用此CSS作为近距离锚点

a.close {
    cursor: default; /* modern browsers */
    cursor: hand;    /* old IE - property is ignored by others */
}

答案 4 :(得分:0)

正如AlienArrays和Zword所说,default光标意味着正常的箭头光标。 如果要在元素上使用默认浏览器行为,请使用:

style="cursor: auto;"

如果要强制“手动”样式光标,也可以使用pointer值。表示通常不可点击的内容会在点击时执行操作。

答案 5 :(得分:0)

您可以检查:css中的悬停属性

#element :hover
{
  cursor:pointer;
}
相关问题