I have a website where I first installed
::selection { background: transparent; } ::-moz-selection { background: transparent; } * { -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; -o-user-select: none; user-select: none; }
(Only for artistic effect, not because I'm trying to stop people from copying something.)
But then, later, I want the user to be able to select text from the text box.
I was able to make a selection again,
#commentarea::selection { background: #070707; } #commentarea::-moz-selection { background: #070707; } #commentarea { -moz-user-select: element; -khtml-user-select: element; -webkit-user-select: element; -o-user-select: element; user-select: element; }
but if the user selects something from the text field, it cannot be undone by clicking somewhere. You can deselect the text by moving the carriage (with arrows).
Why? And how can I prevent this?
user1219742
source share