user-select: none; cursor:position;
时间: 2024-04-29 11:24:05 浏览: 79
The CSS properties "user-select" and "cursor" are used to control the user interaction with an element and the appearance of the mouse pointer respectively.
The "user-select" property is used to prevent the user from selecting text or content within an element. When set to "none", the user will not be able to select any content within the element. This property is useful in situations where the content is not meant to be copied or edited by the user.
The "cursor" property is used to change the appearance of the mouse pointer when it is hovering over an element. The "position" value will change the cursor to a crosshair, indicating that the element can be clicked and dragged to a new position. This property is useful for elements that are draggable or resizable.
Example:
```
.element {
user-select: none;
cursor: position;
}
```
In this example, the "element" class will prevent the user from selecting any content within it and will change the cursor to a crosshair when hovering over it, indicating that it can be dragged to a new position.
阅读全文