Skip to main content
Active reading.
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134

Suppose there are two divdivs like this:

.second { cursor: default; user-select: none; -webkit-user-select: none; /* Chrome/Safari/Opera */ -moz-user-select: none; /* Firefox */ -ms-user-select: none; /* IEInternet Explorer/Edge */ -webkit-touch-callout: none; /* iOS Safari */ }
<div class="first"> This is my first div </div> <div class="second"> This is my second div </div>

Set cursor to default so that it will give a unselectable feel to the user/.

Prefix need to be useused to support it in all browsers without. Without a prefix this may not work in all the answers.

Suppose there are two div like this

.second { cursor: default; user-select: none; -webkit-user-select: none; /* Chrome/Safari/Opera */ -moz-user-select: none; /* Firefox */ -ms-user-select: none; /* IE/Edge */ -webkit-touch-callout: none; /* iOS Safari */ }
<div class="first"> This is my first div </div> <div class="second"> This is my second div </div>

Set cursor to default so that it will give a unselectable feel to user/

Prefix need to be use to support it in all browsers without prefix this may not work in all the answers.

Suppose there are two divs like this:

.second { cursor: default; user-select: none; -webkit-user-select: none; /* Chrome/Safari/Opera */ -moz-user-select: none; /* Firefox */ -ms-user-select: none; /* Internet Explorer/Edge */ -webkit-touch-callout: none; /* iOS Safari */ }
<div class="first"> This is my first div </div> <div class="second"> This is my second div </div>

Set cursor to default so that it will give a unselectable feel to the user.

Prefix need to be used to support it in all browsers. Without a prefix this may not work in all the answers.

added 53 characters in body
Source Link
Gaurav Aggarwal
  • 10.2k
  • 8
  • 42
  • 76

Suppose there are two div like this

HTML

<div class="first"> This is my first div </div> <div class="second"> This is my second div </div> 

Here we want to disable text selection of second div. Here is the css for that

CSS

.second { cursor: default; user-select: none; -webkit-user-select: none; /* Chrome/Safari/Opera */ -moz-user-select: none; /* Firefox */ -ms-user-select: none; /* IE/Edge */ -webkit-touch-callout: none; /* iOS Safari */ }
<div class="first"> This is my first div </div> <div class="second"> This is my second div </div>
.second { cursor: default; user-select: none; -webkit-user-select: none; /* Chrome/Safari/Opera */ -moz-user-select: none; /* Firefox */ -ms-user-select: none; /* IE/Edge */ -webkit-touch-callout: none; /* iOS Safari */ } 
 

Set cursor to default so that it will give a unselectable feel to user/

Prefix need to be use to support it in all browsers without prefix this may not work in all the answers.

Suppose there are two div like this

HTML

<div class="first"> This is my first div </div> <div class="second"> This is my second div </div> 

Here we want to disable text selection of second div. Here is the css for that

CSS

.second { cursor: default; user-select: none; -webkit-user-select: none; /* Chrome/Safari/Opera */ -moz-user-select: none; /* Firefox */ -ms-user-select: none; /* IE/Edge */ -webkit-touch-callout: none; /* iOS Safari */ } 

Set cursor to default so that it will give a unselectable feel to user/

Prefix need to be use to support it in all browsers without prefix this may not work in all the answers.

Suppose there are two div like this

.second { cursor: default; user-select: none; -webkit-user-select: none; /* Chrome/Safari/Opera */ -moz-user-select: none; /* Firefox */ -ms-user-select: none; /* IE/Edge */ -webkit-touch-callout: none; /* iOS Safari */ }
<div class="first"> This is my first div </div> <div class="second"> This is my second div </div>
 

Set cursor to default so that it will give a unselectable feel to user/

Prefix need to be use to support it in all browsers without prefix this may not work in all the answers.

added 100 characters in body
Source Link
Gaurav Aggarwal
  • 10.2k
  • 8
  • 42
  • 76

Suppose there are two div like this

HTML

<div class="first"> This is my first div </div> <div class="second"> This is my second div </div> 

Here we want to disable text selection of second div. Here is the css for that

CSS

.second { cursor: default; user-select: none; -webkit-user-select: none; /* Chrome/Safari/Opera */ -moz-user-select: none; /* Firefox */ -ms-user-select: none; /* IE/Edge */ -webkit-touch-callout: none; /* iOS Safari */ } 

Prefix need to be useSet cursor to supportdefault so that it in all browsers without prefix this may not work in all the answers.will give a unselectable feel to user/

Prefix need to be use to support it in all browsers without prefix this may not work in all the answers.

Suppose there are two div like this

HTML

<div class="first"> This is my first div </div> <div class="second"> This is my second div </div> 

Here we want to disable text selection of second div. Here is the css for that

CSS

.second { user-select: none; -webkit-user-select: none; /* Chrome/Safari/Opera */ -moz-user-select: none; /* Firefox */ -ms-user-select: none; /* IE/Edge */ -webkit-touch-callout: none; /* iOS Safari */ } 

Prefix need to be use to support it in all browsers without prefix this may not work in all the answers.

Suppose there are two div like this

HTML

<div class="first"> This is my first div </div> <div class="second"> This is my second div </div> 

Here we want to disable text selection of second div. Here is the css for that

CSS

.second { cursor: default; user-select: none; -webkit-user-select: none; /* Chrome/Safari/Opera */ -moz-user-select: none; /* Firefox */ -ms-user-select: none; /* IE/Edge */ -webkit-touch-callout: none; /* iOS Safari */ } 

Set cursor to default so that it will give a unselectable feel to user/

Prefix need to be use to support it in all browsers without prefix this may not work in all the answers.

Source Link
Gaurav Aggarwal
  • 10.2k
  • 8
  • 42
  • 76
Loading