根據 Can I use顯示,目前user-select已經支持絕大多數瀏覽器了,不過如果想在IE9或者更早之前使用,還需要使用瀏覽器前綴。
代碼如下
. noselect{
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* 沒有前綴,目前支持Opera和谷歌瀏覽器 */
}