Home>Article>Web Front-end> What is the css font non-copyable code?
The css font cannot be copied code is "-moz-user-select:none; -webkit-user-select:none; -ms-user-select:none; -khtml-user-select:none; - o-user-select:none;user-select:none;", where the "user-select" attribute specifies whether the text of the element can be selected.
The operating environment of this tutorial: Windows 10 system, css3 version, DELL G3 computer
What is the non-copyable code for css fonts?
Using CSS to set the web page text to be read-only and non-copyable
The method to set the web page text to be non-copyable, in addition to the JS implementation we know In addition, it can also be implemented using css.
In CSS, you can set the "user-select:none;" style to the body element to set the text to be non-copiable and only readable.
css setting does not allow copying text content. The method is very simple. You can achieve the goal by setting the user-select of CSS:
-moz-user-select:none; /* Firefox私有属性 */ -webkit-user-select:none; /* WebKit内核私有属性 */ -ms-user-select:none; /* IE私有属性(IE10及以后) */ -khtml-user-select:none; /* KHTML内核私有属性 */ -o-user-select:none; /* Opera私有属性 */ user-select:none; /* CSS3属性 */ user-select属性设置或检索是否允许用户选中文本。 user-select的默认值是 text:可以选择文本 none:文本不被选择
Related introduction:
user-select attribute Specifies whether the element's text can be selected.
In a web browser, if you double-click on text, the text will be selected or highlighted. This property is used to prevent this behavior.
CSS Grammar
user-select: auto|none|text|all;
Attribute value:
Recommended learning: "css video tutorial"
The above is the detailed content of What is the css font non-copyable code?. For more information, please follow other related articles on the PHP Chinese website!