Learn how to disable text selection in HTML with CSS.
This text can be selected.
This text cannot be selected.
You can use the user-select
property to disable text selection of an element.
In web browsers, if you double-click on some text it will be selected/highlighted. This property can be used to prevent this.
.prevent-select {
-webkit-user-select: none; /* Safari */
-ms-user-select: none; /* IE 10 and IE 11 */
user-select: none; /* Standard syntax */
}
Try it Yourself »
Tip: Go to our CSS user-select Reference to learn more the user-select property.
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!