::selection
and user-select: none;
do the same thing I am finding.
I want to prevent the YouTube screen from being highlighted when I double click on the background.
Which can be seen here: https://jsfiddle.net/0fzuv45p/
The YouTube screen itself can’t be highlighted when I double click on the background.
Using both codes.
Which would be the better choice to use here?
https://jsfiddle.net/1sj9e63y/
iframe::selection {
background: none;
}
https://jsfiddle.net/or01a8zf/
iframe{
user-select: none;
}
If you change background: none; to a color, and then double click on the background.
You can see it is red.
https://jsfiddle.net/kmtv2d37/
iframe::selection {
background: red;
}
Which of these should I be using to prevent the YouTube screen from being highlighted when I double click on the background?
For what I want to do, is one code/way/method preferred over the other?
https://developer.mozilla.org/en-US/docs/Web/CSS/::selection
iframe::selection {
background: none;
}
https://developer.mozilla.org/en-US/docs/Web/CSS/user-select
iframe{
user-select: none;
}