Button border radius and cursor

后端 未结 3 1626
渐次进展
渐次进展 2020-12-11 23:48

CSS border radius does affect button rendering (I see it\'s round form), but does not affect how it interacts with the user (I still can click button outside its border). Ho

3条回答
  •  佛祖请我去吃肉
    2020-12-12 00:42

    how are you?

    It's not actually "broken", since it's the way it's supposed to work, so you can't really fix it, all elements render as rectangles in the browser (if you inspect the round button, you'll see it covers a rectangular area)

    You can either (as @Greg pointed out) use the tag, or you can use JavaScript to do the following:

    • If outside the circle coords, show a regular mouse icon; If inside, show a pointer
    • If outside the circle coords, return false in the onclick method; If inside, return true.

    I hope this helps, let me know if you need help with the JS code.

    Cheers!

提交回复
热议问题