Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用css2/js/html使div容器不可选择_Html_Css - Fatal编程技术网

如何使用css2/js/html使div容器不可选择

如何使用css2/js/html使div容器不可选择,html,css,Html,Css,我尝试了::selection,-moz,-webkit,-o,node.setAttribute(“unselectable”,“on”)一些东西,但没有任何效果。有人对此有什么想法吗?您可以尝试使用用户选择:无带前缀: 测试页面: element { -webkit-user-select: none; /* Chrome all / Safari all */ -moz-user-select: none; /* Firefox all */ -ms-user-se

我尝试了
::selection,-moz,-webkit,-o,node.setAttribute(“unselectable”,“on”)
一些东西,但没有任何效果。有人对此有什么想法吗?

您可以尝试使用
用户选择:无带前缀:

测试页面:

element {
  -webkit-user-select: none;  /* Chrome all / Safari all */
  -moz-user-select: none;     /* Firefox all */
  -ms-user-select: none;      /* IE 10+ */
  -o-user-select: none;       /* Opera */
  user-select: none;          /* regular */
}