While working on some stuff I cam across a CSS3 pseudo-class selector called
You may wonder how this could be annoying, and quite simply, think about what would happen if selected text disappears. It would no longer be selected and then have to reappear, unselected. Thus the end result is text you cannot highlight without altering the CSS. So the code for that looks something like this.
I've only tried this in Firefox 10, but when I do it on Firefox, the text is impossible to highlight, however I can drag the text. As to the effects it will have in other browsers that support it, well that's all part in the fun in trying to mess with things to get results like this.
::selection
. While this is something you can do in javascript, it makes things a lot easier when styling can all be done in CSS rather than javascript workarounds. The javascript equivalent would be rather annoying to do. So the CSS3 way, as with any CSS, is rather simple and quick to do, minus a few catches here and there. CSS3 still lacks a good deal of support and isn't good if you want some real backwards compatibility, however I'm more interested in how to use this to just screw with things in ways it could be exploited, bad or just annoying and this particular property hit right on the head for some annoying fun.You may wonder how this could be annoying, and quite simply, think about what would happen if selected text disappears. It would no longer be selected and then have to reappear, unselected. Thus the end result is text you cannot highlight without altering the CSS. So the code for that looks something like this.
::selection { display: none; } ::-moz-selection { display: none; }
I've only tried this in Firefox 10, but when I do it on Firefox, the text is impossible to highlight, however I can drag the text. As to the effects it will have in other browsers that support it, well that's all part in the fun in trying to mess with things to get results like this.
Try to highlight this and see what happens if your browser supports it.
No comments:
Post a Comment