Accurately detect mouseover event for a div with rounded corners

前端 未结 5 733
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-06 08:42

I am trying to detect a mouseover event on a circle. I define the circle div like this:

.circle {
  width: 80px;
  height: 80px;
  -moz-border-radius: 40px;
  -         


        
5条回答
  •  萌比男神i
    2021-02-06 09:11

    No, there is not. Think in geometrical terms. You're still using a div, which is a box element. That box element has a specific rectangular boundary that triggers the mouse over event. The use of CSS to supply a rounded border is cosmetic only, and does not change the rectangular boundary of that element.

提交回复
热议问题