早睡早起,方能养生
Sleep early rise early, way to keep healthy

CSS阻止页面文字被鼠标选中 (PC+移动端)

super
2022-05-29 18:25
views 2332

PC禁止文字选中:

 

user-select: none;

 

移动端禁止文字选中:

 

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

 

如果双端都需要禁用:

 

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


分享
0 条讨论
top