Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS [draggable] elements

[draggable] {
    -moz-user-select: none;
    -khtml-user-select: none;
    -webkit-user-select: none;
    user-select: none;
}

Is the [draggable] referring to any draggable element? If not what does it mean? I see the user-select is being set so that text is not accidentally selected from what the comments tell me.

like image 576
Eae Avatar asked Sep 23 '26 22:09

Eae


1 Answers

It simply means disable user-select for ANY element having attribute draggable, it's an attribute selector to be more specific, you can use element [attr=val] where it will target an element, having that attr val pair.

Demo


You can also use something like element [attr] but this selector wont check the value of the attribute, but you can select a specific element having that attribute regardless of the value.

like image 188
Mr. Alien Avatar answered Sep 26 '26 17:09

Mr. Alien



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!