change cursor to finger pointer

前端 未结 10 2091
孤街浪徒
孤街浪徒 2021-01-30 15:17

I have this a and I don\'t know that I need to insert into the \"onmouseover\" so that the cursor will change to finger pointer like a regular link:



        
10条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-30 15:57

    I think the "best answer" above, albeit programmatically accurate, does not actually answer the question posed. the question asks how to change the pointer in the mouseover event. I see posts about how one may have an error somewhere is not answering the question. In the accepted answer, the mouseover event is blank (onmouseover="") and the style option, instead, is included. Baffling why this was done.

    There may be nothing wrong with the inquirer's link. consider the following html:

    Click ME!
    

    When a user mouse's over this link, the pointer will not change to a hand...instead, the pointer will behave like it's hovering over normal text. One might not want this...and so, the mouse pointer needs to be told to change.

    the answer being sought for is this (which was posted by another):

    Click ME!
    

    However, this is ... a nightmare if you have lots of these, or use this kind of thing all over the place and decide to make some kind of a change or run into a bug. better to make a CSS class for it:

    a.lendhand {
      cursor: pointer;
    }
    

    then:

    Click ME!
    

    there are many other ways which would be, arguably, better than this method. DIVs, BUTTONs, IMGs, etc might prove more useful. I see no harm in using ..., though.

    jarett.

提交回复
热议问题