user-select, user-drag

q6hillz·2022년 4월 16일
0

css

목록 보기
16/25

The user-select CSS property controls whether the user can select text. This doesn't have any effect on content loaded as part of a browser's user interface (its chrome), except in textboxes.

텍스트 드래그 멈추기

user-drag

style="user-select: none;"
user-drag: none;

User select is specific to text as mentioned in User Select - MDN web Docs by default, user-select is enable to texts. To disable that property use the below-mentioned CSS stylings.

-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
User Drag is generic, that can be applied to div, image, p, etc.,

<p draggable="true">Contents</p> //Enable dragging
<img src="image.jpg" draggable="false" alt="can't be dragged"></img> //Disable dragging

user-select는 text에 국한되는 반면에 user-drag와 같은 경우는 dom elem의 drag에도 적용된다.

0개의 댓글