Alex Rivera | Logout

Is there a way to make text unselectable on an HTML page?

Asked 2008-09-16T04:39:50.863
151

I'm building an HTML UI with some text elements, such as tab names, which look bad when selected. Unfortunately, it's very easy for a user to double-click a tab name, which selects it by default in many browsers.

I might be able to solve this with a JavaScript trick (I'd like to see those answers, too) -- but I'm really hoping there's something in CSS/HTML directly that works across all browsers.

Edit
Report

1 Answer

1

There are many occasions when turning off selectability enhances the user experience.

For instance allowing the user to copy a block of text on the page without copying the text of any interface elements associated with it (that would become interspersed within the text being copied).

answered 2011-11-21T23:07:47.240

Your Answer