B0b Posted June 23, 2010 Share Posted June 23, 2010 Hi everyone, I would like to know how, via CSS, we may make text not clickable? For instance, if you click on my message and move your mouse, it will highlight it in blue: that's what I'd like to remove! Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/205649-css-make-text-not-clickable/ Share on other sites More sharing options...
ignace Posted June 23, 2010 Share Posted June 23, 2010 Post some screens and relevant code. Quote Link to comment https://forums.phpfreaks.com/topic/205649-css-make-text-not-clickable/#findComment-1076172 Share on other sites More sharing options...
B0b Posted June 23, 2010 Author Share Posted June 23, 2010 I wish text not to be highlighted when we click and drag our mouse on it (ie. what you do when you wish to copy/paste a block of text). Quote Link to comment https://forums.phpfreaks.com/topic/205649-css-make-text-not-clickable/#findComment-1076182 Share on other sites More sharing options...
haku Posted June 23, 2010 Share Posted June 23, 2010 It's not really possible to do this, though you can hack it in a few ways: 1) Make the text an image. 2) Cover the text with another invisible element Though why you would want to do this is beyond me. The first method will prevent the text from being copied at all (since it only exists in the image), but the second can be circumvented by someone who knows what they are doing. Quote Link to comment https://forums.phpfreaks.com/topic/205649-css-make-text-not-clickable/#findComment-1076183 Share on other sites More sharing options...
ignace Posted June 23, 2010 Share Posted June 23, 2010 Is it possible to change the color of the select? I've seen a website do it but couldn't figure out how (:select perhaps or something?) -- found it http://css-tricks.com/overriding-the-default-text-selection-color-with-css/ Quote Link to comment https://forums.phpfreaks.com/topic/205649-css-make-text-not-clickable/#findComment-1076222 Share on other sites More sharing options...
Dragosvr92 Posted July 1, 2010 Share Posted July 1, 2010 Here is how i do it on a page of mine ::selection {background: grey;color: white;}/*Normal*/ ::-moz-selection{background: grey;color: white;}/*Mozilla*/ ::-webkit-selection{background: grey;color: white;}/*Safari*/ Set the colors as you wish to match with your body background Quote Link to comment https://forums.phpfreaks.com/topic/205649-css-make-text-not-clickable/#findComment-1079449 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.