当鼠标悬停在输入文件或输入文本上时,我应该如何使光标变为指针?
这是我的尝试,但显然不起作用:
<input type="file" style="cursor: pointer;"/>
我需要使用 JavaScript(jQuery)吗? 编辑: 抱歉,我的错误-光标确实会在...上变成一个点。
<input type="text" style="cursor: pointer;"/>
但不包括
<input type="file" style="cursor: pointer;"/>
您可以在Firefox上测试此链接,然后您就会明白我的意思。
只有
文件
的按钮
变成了指针,而不是文件
的输入框
。
编辑2:
这里是我的CSS“hack”,点击此处。<div id="right-col" style="position:relative; width:76px; height:24px; overflow:hidden; border:1px solid #000;">
<input type="file" style="position:absolute; top:0; right:0; z-index:2;opacity:1; cursor:pointer;"/>
</div>