gpt4 book ai didi

css - 防止在 Chrome 中突出显示 Canvas 区域

转载 作者:太空宇宙 更新时间:2023-11-04 14:22:02 25 4
gpt4 key购买 nike

在我们的白板应用程序中,如果 Chrome 用户以某种方式拖动鼠标,他们能够突出显示整个 Canvas :

关于如何防止这种情况发生的任何想法?谢谢!

最佳答案

在 Chrome 中,将此 CSS 应用于正文似乎对我有用:

-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;

其他人说 Opera 和 IE 还不支持这些属性,相反,您需要在元素上设置 unselectable 属性,如下所示:

<body unselectable="on">

我没有这些浏览器,所以我无法确认这一点,但您可以查看这些帖子以了解更多详细信息:

How to disable text selection highlighting using CSS?

Is there a way to make text unselectable on an HTML page?

关于css - 防止在 Chrome 中突出显示 Canvas 区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9337997/

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