gpt4 book ai didi

css - 如何使应用了 border-radius 的元素的径向部分在 chrome 和 safari 中无法选择?

转载 作者:行者123 更新时间:2023-11-28 18:47:34 30 4
gpt4 key购买 nike

在这个圆圈中,我注意到只有当光标在 IE9 和 Firefox 的圆圈内时指针才会出现。然而在 safari 或 chrome 中,如果你在 div 元素内的任何地方,即使你在圆圈之外,光标也是一个指针。

div#circle {
width: 200px;
height: 200px;
-moz-border-radius:100px;
-webkit-border-radius:100px;
border-radius:100px;
background: red;
cursor:pointer }

<div id = "circle"></div>

看看 IE9 和 Firefox 中的这个 fiddle ,并与 Safari 和 Chrome 进行比较。 http://jsfiddle.net/GC4yU/

有什么方法可以使这段代码的功能与它在 ie9 和 firefox 中在 chrome 和 safari 中的功能相同吗?

最佳答案

差异可能是由于 HTML 引擎的工作方式所致。我不知道是什么原因造成的。但您可以考虑以下替代方案:

<svg  xmlns="http://www.w3.org/2000/svg" version="1.1">
<circle style="cursor:pointer" cx="100" cy="50" r="40"
stroke="black" stroke-width="2" fill="red" />
</svg>

关于css - 如何使应用了 border-radius 的元素的径向部分在 chrome 和 safari 中无法选择?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10146880/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com