开发者

<A> attribute gives Edit cursor on hover

I am defining three menu buttons

<div id="buttonscontainer">
    <ul>
    <li><a unselectable="on" value="insert" onClick="insertText('[BEFORE]', '[AFTER]'); return false;">Bold</a></li>
    <li><a unselectable="on" value="insert" onClick="insertText('[BEFOR开发者_运维知识库E]', '[AFTER]'); return false;">Italic</a></li>
    <li><a unselectable="on" value="insert" onClick="insertText('[BEFORE]', '[AFTER]'); return false;">Image</a></li>
    </ul>
    </div>

I use <a> tag to create simple text button with OnClick jscript.

The problem is that when user hovers over the link the cursors is changed to edit (like editbox cursor)

Why is that behaviuor? Or do I have to look in CSS for particular attribute


You either need to add the href attribute to your anchor or in CSS you can add:

#buttonscontainer a:hover
{
    cursor: pointer;
}

Either of those will change the cursor to the pointer :)

jsFiddle example.


I think the problem is that you need to add a href attribute to your links:

<a .. href="#">Bold</a>

Or, you could add this CSS:

a {
    cursor: pointer
}

but that seems a little silly. Just add the href, and fix the styling of the links (demo).


I think the problem is that your tag is missing required atribute href. Try putting in empty href=""

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜