BillyRayPreachersSon
Programmer
I found an interesting CSS property today, while searching for a way to make text unselectable in Firefox.
In IE, it is fairly simple... either add:
to an element, or use JavaScript:
Unfortunately, Firefox supports neither of these methods. It does, however, support one of the proposed CSS3 properties, "user-select".
Because the specifications have not been finalised, it needs to be accessed by it's "pre-release" name, "-moz-user-select".
Anyway, to stop text being selectable in FF, and any future browsers that support the property, you can use:
I've just found this very useful... hope someone else does, too.
Dan
[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
![[banghead] [banghead] [banghead]](/data/assets/smilies/banghead.gif)
In IE, it is fairly simple... either add:
Code:
unselectable="false"
to an element, or use JavaScript:
Code:
el.onselectstart = function() { return(false); };
Unfortunately, Firefox supports neither of these methods. It does, however, support one of the proposed CSS3 properties, "user-select".
Because the specifications have not been finalised, it needs to be accessed by it's "pre-release" name, "-moz-user-select".
Anyway, to stop text being selectable in FF, and any future browsers that support the property, you can use:
Code:
selector {
-moz-user-select: none;
user-select: none;
}
I've just found this very useful... hope someone else does, too.
Dan
[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
![[banghead] [banghead] [banghead]](/data/assets/smilies/banghead.gif)