Front-end: Implementing the selection and unselectability of div elements

By default, the div element can be selected, but if you need to set it to cannot be selected, you can set it as follows: < /span> 

div {
    user-select: none;
}

If you wish toallow selection in certain circumstances, you can override this style where needed. For example:

div.allow-select {
    user-select: auto;
}

Guess you like

Origin blog.csdn.net/weixin_46001736/article/details/134716973