Tutorials: CSS

Disabling Text Selection, Forcing Text Highlighting with CSS

This tutorial will show you how to disable the selection of text and force the highlighting of text with the use of CSS. Disable Text Selection 1. Insert the following code into your CSS file. .no-select { -webkit-touch-callout:none; -webkit-user-select:none; -khtml-user-select:none; -moz-user-select:none; -ms-user-select:none; -o-user-select:none; user-select:none; } 2. Give your text the class .no-select. 3. Example result: I am a brave and strong paragraph. The CSS class .no-select empowers me. You cannot… Read more