Home >Web Front-end >CSS Tutorial >CSS prohibits selected text

CSS prohibits selected text

王林
王林forward
2020-05-08 09:10:292298browse

CSS prohibits selected text

css code:

.box {    
/* 禁止选中文本 */
    -moz-user-select: none; /*火狐*/
    -webkit-user-select: none; /*webkit浏览器*/
    -ms-user-select: none; /*IE10*/
    -khtml-user-select: none; /*早期浏览器*/
    -webkit-touch-callout: none;    user-select: none;
}

(Video tutorial recommendation: css video tutorial)

Disable right mouse button

<body oncontextmenu="return false;" onselectstart="return false"></body>

Recommended tutorial: css quick start

The above is the detailed content of CSS prohibits selected text. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete