From 64a40466af1722c0a67c5740015a5499b3a9834a Mon Sep 17 00:00:00 2001 From: Rohit Tanwar <31792358+kriadmin@users.noreply.github.com> Date: Mon, 26 Feb 2018 22:39:58 +0530 Subject: [PATCH 1/3] Create disable-selection. --- snippets/disable-selection.md | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 snippets/disable-selection.md diff --git a/snippets/disable-selection.md b/snippets/disable-selection.md new file mode 100644 index 000000000..d39f99d53 --- /dev/null +++ b/snippets/disable-selection.md @@ -0,0 +1,50 @@ +### Disable Selection + +Makes the content unselectable. + +#### HTML + +```html +
+

You can't select me!

+

You can select me!!

+
+``` + +#### CSS + +```css +.unselectable { + user-select: none; +} +``` + +#### Demo + + + +
+

You can't select me!

+

You can select me!!

+
+ + + + + +#### Explanation +`user-select: none` defines that the text cannot be selected. +#### Browser support + + + +⚠️ Requires prefixes for full support and is not actually in any specification. + + + +* https://caniuse.com/#search=user-select From 659b8719208dad2982822168aa1c4619faf308da Mon Sep 17 00:00:00 2001 From: atomiks Date: Wed, 28 Feb 2018 21:56:26 +1000 Subject: [PATCH 2/3] Update disable-selection.md --- snippets/disable-selection.md | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/snippets/disable-selection.md b/snippets/disable-selection.md index d39f99d53..e84b402ec 100644 --- a/snippets/disable-selection.md +++ b/snippets/disable-selection.md @@ -1,4 +1,4 @@ -### Disable Selection +### Disable selection Makes the content unselectable. @@ -6,8 +6,8 @@ Makes the content unselectable. ```html
-

You can't select me!

-

You can select me!!

+

You can select me.

+

You can't select me!

``` @@ -21,30 +21,23 @@ Makes the content unselectable. #### Demo - -
+

You can select me.

You can't select me!

-

You can select me!!

- - #### Explanation -`user-select: none` defines that the text cannot be selected. + +`user-select: none` specifies that the text cannot be selected. + #### Browser support - +⚠️ Requires prefixes for full support. -⚠️ Requires prefixes for full support and is not actually in any specification. - - - -* https://caniuse.com/#search=user-select +* https://caniuse.com/#feat=user-select-none From 94d4ef171fb43eaa187da63007233e2b0bc779a0 Mon Sep 17 00:00:00 2001 From: atomiks Date: Wed, 28 Feb 2018 21:57:20 +1000 Subject: [PATCH 3/3] Update disable-selection.md --- snippets/disable-selection.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/snippets/disable-selection.md b/snippets/disable-selection.md index e84b402ec..3250911b7 100644 --- a/snippets/disable-selection.md +++ b/snippets/disable-selection.md @@ -5,10 +5,8 @@ Makes the content unselectable. #### HTML ```html -
-

You can select me.

-

You can't select me!

-
+

You can select me.

+

You can't select me!

``` #### CSS